From db3b4c58ce7164c3f1c2155c99c9a1addbd035f9 Mon Sep 17 00:00:00 2001 From: Diederik de Haas Date: Mon, 30 Aug 2021 17:26:05 +0200 Subject: [PATCH] Put each nameserver on its own line in resolv.conf. It previously wrote "nameserver dns-server-1 nameserver dns-server-2" into /etc/resolv.conf, which is incorrect. Thanks to ajones11235 for spotting the error and suggesting a fix. Closes #534 Signed-off-by: Diederik de Haas --- scripts/etc/init.d/rcS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/etc/init.d/rcS b/scripts/etc/init.d/rcS index 8f6d7d43..5a9d6e1b 100755 --- a/scripts/etc/init.d/rcS +++ b/scripts/etc/init.d/rcS @@ -563,7 +563,7 @@ else ip addr add "$ip4_addr"/"$ip4_prefixlength" dev $ifname || fail ip route add default via "$ip4_gateway" || fail for i in $ip4_nameservers; do - printf "nameserver %s" "$i" >> /etc/resolv.conf + printf "nameserver %s\n" "$i" >> /etc/resolv.conf done have_ip4=$ip4_addr log_msg_end "OK" @@ -653,7 +653,7 @@ if [ -n "$have_ip6" ]; then fi if [ -n "$have_ip6_nameservers" ]; then for i in $have_ip6_nameservers; do - printf "nameserver %s" "$i" >> /etc/resolv.conf + printf "nameserver %s\n" "$i" >> /etc/resolv.conf done fi log_msg_end "OK"