From e8b5f72496f64b25a47e20bd48ed9d98d9bd1626 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Sat, 25 Oct 2014 22:09:37 -0500 Subject: domain and search should not both be defined in resolv.conf per FreeBSD man page and handbook (only the latter is actually used). Change this to just not use domain, and set the search to the system's domain where not using the function that generates the search list for dynamic WANs. --- etc/inc/system.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/inc/system.inc b/etc/inc/system.inc index e903cdb..02f824b 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -109,10 +109,6 @@ function system_resolvconf_generate($dynupdate = false) { $syscfg = $config['system']; - // Do not create blank domain lines, it breaks tools like dig. - if($syscfg['domain']) - $resolvconf = "domain {$syscfg['domain']}\n"; - if (((isset($config['dnsmasq']['enable']) && (empty($config['dnsmasq']['interface']) || in_array("lo0", explode(",", $config['dnsmasq']['interface'])))) || (isset($config['unbound']['enable'])) && (empty($config['unbound']['active_interface']) || in_array("lo0", explode(",", $config['unbound']['active_interface'])))) && !isset($config['system']['dnslocalhost'])) @@ -130,6 +126,10 @@ function system_resolvconf_generate($dynupdate = false) { if($nameserver) $resolvconf .= "nameserver $nameserver\n"; } + } else { + // Do not create blank search/domain lines, it can break tools like dig. + if($syscfg['domain']) + $resolvconf = "search {$syscfg['domain']}\n"; } if (is_array($syscfg['dnsserver'])) { foreach ($syscfg['dnsserver'] as $ns) { -- cgit v1.1