summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2016-02-11 17:52:25 -0600
committerChris Buechler <cmb@pfsense.org>2016-02-11 17:52:25 -0600
commitefebd867ec266120cc682e20bae15b38cae6c04a (patch)
treec3547bf7daf709aef6fa4cfe02555568e4896e29
parentb76fd2a05664379c6752c5ee28c42462348d5d51 (diff)
downloadpfsense-efebd867ec266120cc682e20bae15b38cae6c04a.zip
pfsense-efebd867ec266120cc682e20bae15b38cae6c04a.tar.gz
Prefer dnsmasq's host overrides when it's enabled. Ticket #5883
-rw-r--r--etc/inc/system.inc9
1 files changed, 6 insertions, 3 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index ba47740..b0196c3 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -295,10 +295,13 @@ 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";
$hosts .= "::1 localhost localhost.{$syscfg['domain']}\n";
OpenPOWER on IntegriCloud