Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nameserver order that the host IP address is not first #190

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions pkg/bundle/setup/clustersetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ setup_dsnmasq(){
hostName=$(hostname)
pr_info "writing Dnsmasq conf on $DNSMASQ_CONF"
cat << EOF > /etc/dnsmasq.d/crc-dnsmasq.conf
listen-address=$IIP
listen-address=0.0.0.0
expand-hosts
log-queries
local=/crc.testing/
Expand All @@ -111,16 +111,19 @@ address=/apps-crc.testing/$IIP
address=/api.crc.testing/$IIP
address=/api-int.crc.testing/$IIP
address=/$hostName.crc.testing/192.168.126.11
address=/$EIP.nip.io/$IIP
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