diff options
author | Alex Harpin <development@landsofshadow.co.uk> | 2014-09-07 19:59:29 +0100 |
---|---|---|
committer | Alex Harpin <development@landsofshadow.co.uk> | 2014-09-07 19:59:29 +0100 |
commit | 1a2d4456587604730cb29bf635253941a50669ab (patch) | |
tree | a393dc1005aade6aa3aa3eac25ea981b4d5aabd6 /scripts/system/vyatta_update_resolv.pl | |
parent | c4e926d40a6dbc2bb0b24d01ab748bedac58fb35 (diff) | |
download | vyatta-cfg-system-1a2d4456587604730cb29bf635253941a50669ab.tar.gz vyatta-cfg-system-1a2d4456587604730cb29bf635253941a50669ab.zip |
vyatta-cfg-system: prevent dhcp updating dns when statically configured
When DNS settings are statically configured, prevent DHCP interfaces
from appending to resolv.conf with additional name servers. If the
system has been configured with a static name server, just use that
instead of accepting ISP provided name servers. These can be accepted
again by simply deleting the statically configured name servers.
Bug #182 http://bugzilla.vyos.net/show_bug.cgi?id=182
Diffstat (limited to 'scripts/system/vyatta_update_resolv.pl')
-rwxr-xr-x | scripts/system/vyatta_update_resolv.pl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/system/vyatta_update_resolv.pl b/scripts/system/vyatta_update_resolv.pl index d200e0cc..d20eb848 100755 --- a/scripts/system/vyatta_update_resolv.pl +++ b/scripts/system/vyatta_update_resolv.pl @@ -94,7 +94,8 @@ if ($domain_name && length($domain_name) > 0) { } # update /etc/resolv.conf for name-servers received from dhcp client, only done when dhclient-script calls this script -if ($dhclient_script == 1) { +# and there aren't statically configured DNS settings, via 'set system name-server', in place. +if (($dhclient_script == 1) && !($vc->existsOrig('name-server'))) { my @current_dhcp_nameservers; my $restart_ntp = 0; |