Skip to content

Commit

Permalink
Put each nameserver on its own line in resolv.conf.
Browse files Browse the repository at this point in the history
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 debian-pi#534

Signed-off-by: Diederik de Haas <[email protected]>
  • Loading branch information
diederikdehaas committed Aug 30, 2021
1 parent cbdef9a commit db3b4c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/etc/init.d/rcS
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit db3b4c5

Please sign in to comment.