Project

General

Profile

Actions

Bug #12078

closed

DNS Resolution Behavior does not consider named when setting localhost

Added by Marcos M over 3 years ago. Updated over 1 year ago.

Status:
Not a Bug
Priority:
Normal
Assignee:
-
Category:
Web Interface
Target version:
-
Start date:
06/24/2021
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:
Default
Affected Version:
Affected Architecture:

Description

With dnsmasq and unbound disabled, and instead using Bind/named, the setting DNS Resolution Behavior under System / General Setup does not add 127.0.0.1 to /etc/resolv.conf.

It does not appear to cause any issues, as dns lookups seem to default to using localhost (e.g. update checks and DNS Lookup page still work). Given, it's unclear why there are checks for these processes, rather than explicitly setting localhost unless Use remote DNS Servers, ignore local DNS is used.

Additionally, should ::1 for IPv6-only scenarios be taken into account?

Actions #1

Updated by Jim Pingle over 3 years ago

  • Status changed from New to Not a Bug

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.

Actions #2

Updated by Marcos M over 1 year ago

The following patch allows for the localhost DNS server to be added automatically when the DNS Resolution behavior is set to Use remote DNS Servers, ignore local DNS:

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";
     }

This seems like a better way to handle it given it's what the option describes and what a user would expect.

Actions

Also available in: Atom PDF