From 1a2d4456587604730cb29bf635253941a50669ab Mon Sep 17 00:00:00 2001 From: Alex Harpin Date: Sun, 7 Sep 2014 19:59:29 +0100 Subject: 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 --- scripts/system/vyatta_update_resolv.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts/system') 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; -- cgit v1.2.3