]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
unbound: Set domains with local data into type transparent mode
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 6 Apr 2020 15:10:25 +0000 (15:10 +0000)
committerArne Fitzenreiter <arne_f@ipfire.org>
Tue, 7 Apr 2020 08:55:31 +0000 (08:55 +0000)
Records which are from the same domain than the IPFire hostname
might not be returned by unbound. This change explicitely instructs
unbound to check local data before checking the global DNS.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
src/initscripts/system/unbound

index 1cf26ec0e5df089c4d20c27d8dd906d1e80a3835..35477ae28162a14926ed7e7e902885cbd97a0cce 100644 (file)
@@ -72,8 +72,18 @@ write_hosts_conf() {
                        echo "local-data: \"${address} ${LOCAL_TTL} IN PTR ${HOSTNAME}\""
                done
 
-               # Add all hosts
                local enabled address hostname domainname generateptr
+
+               # Find all unique domain names
+               while IFS="," read -r enabled address hostname domainname generateptr; do
+                       [ "${enabled}" = "on" ] || continue
+
+                       echo "${domainname}"
+               done < /var/ipfire/main/hosts | sort -u | while read -r domainname; do
+                       echo "local-zone: ${domainname} typetransparent"
+               done
+
+               # Add all hosts
                while IFS="," read -r enabled address hostname domainname generateptr; do
                        [ "${enabled}" = "on" ] || continue