mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 17:44:41 +00:00
DNSmasq: use domain override for static hosts, closes https://github.com/opnsense/core/pull/4539
This commit is contained in:
parent
8644af058c
commit
1adefd7440
@ -231,11 +231,14 @@ function _dnsmasq_add_host_entries()
|
||||
continue;
|
||||
}
|
||||
|
||||
$domain = $config['system']['domain'];
|
||||
if ($host['domain']) {
|
||||
if (!empty($host['domain'])) {
|
||||
$domain = $host['domain'];
|
||||
} elseif ($dhcpifconf['domain']) {
|
||||
} elseif (!empty($dhcpifconf['domain'])) {
|
||||
$domain = $dhcpifconf['domain'];
|
||||
} elseif (!empty($config['dnsmasq']['regdhcpdomain'])) {
|
||||
$domain = $config['dnsmasq']['regdhcpdomain'];
|
||||
} else {
|
||||
$domain = $config['system']['domain'];
|
||||
}
|
||||
|
||||
$dhosts .= "{$host['ipaddr']}\t{$host['hostname']}.{$domain} {$host['hostname']}\n";
|
||||
@ -251,7 +254,6 @@ function _dnsmasq_add_host_entries()
|
||||
if (!$host['ipaddrv6'] || !$host['hostname']) {
|
||||
continue;
|
||||
}
|
||||
$domain = $config['system']['domain'];
|
||||
// XXX: dhcpdv6 domain entries have been superseded by domainsearchlist,
|
||||
// for backward compatibilty support both here.
|
||||
if (!empty($host['domainsearchlist'])) {
|
||||
@ -262,7 +264,12 @@ function _dnsmasq_add_host_entries()
|
||||
$domain = $dhcpifconf['domainsearchlist'];
|
||||
} elseif (!empty($dhcpifconf['domain'])) {
|
||||
$domain = $dhcpifconf['domain'];
|
||||
} elseif (!empty($config['dnsmasq']['regdhcpdomain'])) {
|
||||
$domain = $config['dnsmasq']['regdhcpdomain'];
|
||||
} else {
|
||||
$domain = $config['system']['domain'];
|
||||
}
|
||||
|
||||
$domain = explode(";", $domain)[0]; // XXX: first entry of domainsearchlist
|
||||
$dhosts .= "{$host['ipaddrv6']}\t{$host['hostname']}.{$domain} {$host['hostname']}\n";
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user