https://redmine.pfsense.org/https://redmine.pfsense.org/favicon.ico?16780521162021-06-25T07:33:50ZpfSense bugtrackerpfSense - Bug #12078: DNS Resolution Behavior does not consider named when setting localhosthttps://redmine.pfsense.org/issues/12078?journal_id=547322021-06-25T07:33:50ZJim Pingle
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Not a Bug</i></li></ul><p>Since named is a package, it doesn't integrate into base in that way by design. If someone wants to set that up and use it in that way, they need to manually configure things and not use features which are built around the base system components.</p> pfSense - Bug #12078: DNS Resolution Behavior does not consider named when setting localhosthttps://redmine.pfsense.org/issues/12078?journal_id=669402023-04-18T20:03:36ZMarcos M
<ul></ul><p>The following patch allows for the localhost DNS server to be added automatically when the DNS Resolution behavior is set to <code>Use remote DNS Servers, ignore local DNS</code>:<br /><pre>
diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc
index 37df27053e..2005d30cb9 100644
--- a/src/etc/inc/system.inc
+++ b/src/etc/inc/system.inc
@@ -1270,7 +1270,7 @@ function get_dns_nameservers($add_v6_brackets = false, $hostns=true) {
(config_path_enabled('unbound') &&
(config_get_path('unbound/port', '53') == '53') &&
(in_array("lo0", explode(",", config_get_path('unbound/active_interface', 'lo0'))) ||
- in_array("all", explode(",", config_get_path('unbound/active_interface', 'all')), true))) &&
+ in_array("all", explode(",", config_get_path('unbound/active_interface', 'all')), true))) ||
(config_get_path('system/dnslocalhost') != 'remote')) {
$dns_nameservers[] = "127.0.0.1";
}
</pre></p>
<p>This seems like a better way to handle it given it's what the option describes and what a user would expect.</p>