From: Michael Tremer Date: Mon, 6 Apr 2020 15:10:25 +0000 (+0000) Subject: unbound: Set domains with local data into type transparent mode X-Git-Tag: v2.25-core143~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1b6b8d97aac8a8056a4ef5c9d571a1947551e17f;p=ipfire-2.x.git unbound: Set domains with local data into type transparent mode 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 Signed-off-by: Arne Fitzenreiter --- diff --git a/src/initscripts/system/unbound b/src/initscripts/system/unbound index 1cf26ec0e5..35477ae281 100644 --- a/src/initscripts/system/unbound +++ b/src/initscripts/system/unbound @@ -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