mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
When clicked allow overriding of dns servers by dynamic WANs still configure the other dns servers so in multi-WAN environments dns has a chance to work still.
This commit is contained in:
parent
6265b04139
commit
b03bf7ab38
@ -90,33 +90,25 @@ function system_resolvconf_generate($dynupdate = false) {
|
||||
if($syscfg['domain'])
|
||||
$resolvconf = "domain {$syscfg['domain']}\n";
|
||||
|
||||
$havedns = false;
|
||||
|
||||
$resolvconf .= "nameserver 127.0.0.1\n";
|
||||
|
||||
if (isset($syscfg['dnsallowoverride'])) {
|
||||
/* get dynamically assigned DNS servers (if any) */
|
||||
$ns = array_unique(get_searchdomains());
|
||||
foreach($ns as $searchserver) {
|
||||
if($searchserver) {
|
||||
if($searchserver)
|
||||
$resolvconf .= "search {$searchserver}\n";
|
||||
$havedns = true;
|
||||
}
|
||||
}
|
||||
$ns = array_unique(get_nameservers());
|
||||
foreach($ns as $nameserver) {
|
||||
if($nameserver) {
|
||||
if($nameserver)
|
||||
$resolvconf .= "nameserver $nameserver\n";
|
||||
$havedns = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$havedns && is_array($syscfg['dnsserver'])) {
|
||||
if (is_array($syscfg['dnsserver'])) {
|
||||
foreach ($syscfg['dnsserver'] as $ns) {
|
||||
if ($ns) {
|
||||
if ($ns)
|
||||
$resolvconf .= "nameserver $ns\n";
|
||||
$havedns = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user