]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
unbound: Update setting Safe Search redirects
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 7 Jan 2020 14:57:12 +0000 (14:57 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 7 Jan 2020 15:03:56 +0000 (15:03 +0000)
When the system comes online, we must update entries
in the unbound cache to point to the "safe" IP addresses.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/system/unbound

index 138b9623565a047de577309909ebad0135663c1c..bb78fd18aeaba10259eac28e3c80a445dfbdb7ce 100644 (file)
@@ -18,12 +18,6 @@ LOCAL_TTL=60
 # Load configuration
 eval $(/usr/local/bin/readhash /var/ipfire/dns/settings)
 
-DIG_ARGS=()
-
-if [ "${PROTO}" = "TCP" ]; then
-       DIG_ARGS+=( "+tcp" )
-fi
-
 ip_address_revptr() {
        local addr=${1}
 
@@ -290,21 +284,12 @@ fix_time_if_dns_fail() {
 resolve() {
        local hostname="${1}"
 
-       local found=0
-       local ns
-       for ns in $(read_name_servers); do
-               local answer
-               for answer in $(dig "${DIG_ARGS[@]}" +short "@${ns}" A "${hostname}"); do
-                       found=1
-
-                       # Filter out non-IP addresses
-                       if [[ ! "${answer}" =~ \.$ ]]; then
-                               echo "${answer}"
-                       fi
-               done
-
-               # End loop when we have got something
-               [ ${found} -eq 1 ] && break
+       local answer
+       for answer in $(dig +short A "${hostname}"); do
+               # Filter out non-IP addresses
+               if [[ ! "${answer}" =~ \.$ ]]; then
+                       echo "${answer}"
+               fi
        done
 }
 
@@ -609,6 +594,9 @@ case "$1" in
 
        update-forwarders)
                : # XXX must set ISP name servers if necessary
+
+               # Update Safe Search settings
+               update_safe_search
                ;;
 
        remove-forwarders)