Skip to content

Commit

Permalink
Fix nameserver order that the host IP address is not first
Browse files Browse the repository at this point in the history
The host nameserver in the /etc/resolv.conf needs to be first, to avoid
potential future issues.
  • Loading branch information
danpawlik committed Jul 3, 2024
1 parent eac7dcf commit 98377fa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/bundle/setup/clustersetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,13 @@ EOF
stop_if_failed $? "failed to write Dnsmasq configuration in $DNSMASQ_CONF"
pr_info "adding Dnsmasq as primary DNS"
sleep 2
nmcli connection modify Wired\ connection\ 1 ipv4.dns "$IIP,169.254.169.254"
CURRENT_NAMESERVERS=$(grep "nameserver" /etc/resolv.conf | awk '{print $2}' | xargs | sed 's/ /,/g')
nmcli connection modify "Wired connection 1" ipv4.dns "$IIP,$CURRENT_NAMESERVERS"
nmcli connection up "Wired connection 1"
stop_if_failed $? "failed to modify NetworkManager settings"
pr_info "restarting NetworkManager"
sleep 2
systemctl restart NetworkManager
systemctl restart NetworkManager
stop_if_failed $? "failed to restart NetworkManager"
pr_info "enabling & starting Dnsmasq service"
systemctl enable dnsmasq.service
Expand Down

0 comments on commit 98377fa

Please sign in to comment.