From 57cc55d8bab4640f8245ececa03b115a1524197f Mon Sep 17 00:00:00 2001 From: Alex Harpin Date: Mon, 9 Feb 2015 21:01:35 +0000 Subject: vyatta-cfg-system: invalid resolv.conf format causing extra DNS request The resolv.conf file contains comments at the end of the search and domain entries which cause unexpected behaviour on lookups. Moving these to the line above in each case fixes the issue. Bug #468 http://bugzilla.vyos.net/show_bug.cgi?id=468 --- scripts/system/vyatta_update_resolv.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/system/vyatta_update_resolv.pl b/scripts/system/vyatta_update_resolv.pl index 921052f0..93e6041d 100755 --- a/scripts/system/vyatta_update_resolv.pl +++ b/scripts/system/vyatta_update_resolv.pl @@ -96,12 +96,12 @@ if (!defined($domain_name)) { my $search = ''; if (length($doms) > 0) { - $search = "search\t\t$doms\t\t#line generated by $0\n"; + $search = "#line generated by $0\nsearch\t\t$doms\n"; } my $domain = ''; if ($domain_name && length($domain_name) > 0) { - $domain = "domain\t\t$domain_name\t\t#line generated by $0\n"; + $domain = "#line generated by $0\ndomain\t\t$domain_name\n"; } # update /etc/resolv.conf with name-servers received from dhcp client, done when this script is called @@ -221,7 +221,7 @@ foreach my $line (@resolv) { if (length($domain) > 0) { print $r $domain; } - } else { + } elsif ($line !~ /^#line generated by\s/) { print $r $line; } } -- cgit v1.2.3