diff options
-rw-r--r-- | src/etc/inc/system.inc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index 89d38cc..21f166b 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -336,10 +336,12 @@ function system_hosts_generate() { } $syscfg = $config['system']; - if (isset($config['unbound']) && isset($config['unbound']['enable'])) { - $dnsmasqcfg = $config['unbound']; - } else { + // prefer dnsmasq for hosts generation where it's enabled. It relies + // on hosts for name resolution of its overrides, unbound does not. + if (isset($config['dnsmasq']) && isset($config['dnsmasq']['enable'])) { $dnsmasqcfg = $config['dnsmasq']; + } else { + $dnsmasqcfg = $config['unbound']; } $hosts = "127.0.0.1 localhost localhost.{$syscfg['domain']}\n"; |