Skip to content

Commit 20b1af8

Browse files
committed
Fix nameserver order that the host IP address is not first
The host nameserver in the /etc/resolv.conf needs to be first, to avoid potential future issues.
1 parent eac7dcf commit 20b1af8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/bundle/setup/clustersetup.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,13 @@ EOF
116116
stop_if_failed $? "failed to write Dnsmasq configuration in $DNSMASQ_CONF"
117117
pr_info "adding Dnsmasq as primary DNS"
118118
sleep 2
119-
nmcli connection modify Wired\ connection\ 1 ipv4.dns "$IIP,169.254.169.254"
119+
CURRENT_NAMESERVERS=$(grep "nameserver" /etc/resolv.conf | awk '{print $2}' | xargs | sed 's/ /,/g')
120+
nmcli connection modify "Wired connection 1" ipv4.dns "$IIP,$CURRENT_NAMESERVERS"
121+
nmcli connection up "Wired connection 1"
120122
stop_if_failed $? "failed to modify NetworkManager settings"
121123
pr_info "restarting NetworkManager"
122124
sleep 2
123-
systemctl restart NetworkManager
125+
systemctl restart NetworkManager
124126
stop_if_failed $? "failed to restart NetworkManager"
125127
pr_info "enabling & starting Dnsmasq service"
126128
systemctl enable dnsmasq.service

0 commit comments

Comments
 (0)