mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
dnsmasq: always listen on loopback, resolv.conf must know
PR: https://github.com/opnsense/core/issues/2562
This commit is contained in:
parent
5f924d263b
commit
188b098110
@ -118,9 +118,11 @@ function dnsmasq_configure_do($verbose = false)
|
||||
}
|
||||
|
||||
if (isset($config['dnsmasq']['interface'])) {
|
||||
$addresses = array('127.0.0.1', '::1');
|
||||
$interfaces = explode(',', $config['dnsmasq']['interface']);
|
||||
$interfaces[] = 'lo0';
|
||||
$addresses = array();
|
||||
|
||||
foreach (explode(',', $config['dnsmasq']['interface']) as $interface) {
|
||||
foreach ($interfaces as $interface) {
|
||||
foreach (legacy_getall_interface_addresses(get_real_interface($interface)) as $tmpaddr) {
|
||||
$tmpaddr = explode('/', $tmpaddr)[0];
|
||||
/* no support for link-local address with scope specified */
|
||||
|
||||
@ -157,9 +157,10 @@ function system_resolvconf_generate($verbose = false)
|
||||
$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'])) {
|
||||
/* XXX Unbound should always bind to loopback like Dnsmasq */
|
||||
if (!isset($config['system']['dnslocalhost']) && (isset($config['dnsmasq']['enable']) ||
|
||||
(isset($config['unbound']['enable']) && (empty($config['unbound']['active_interface']) ||
|
||||
in_array('lo0', explode(',', $config['unbound']['active_interface'])))))) {
|
||||
$resolvconf .= "nameserver 127.0.0.1\n";
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user