Skip to content

Commit 10f828d

Browse files
committed
Add more resolv checks and fixes
1 parent ca88eea commit 10f828d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

ext/standard/tests/dns/resolv-setup.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,27 @@ systemctl is-active systemd-networkd || echo "systemd-networkd disabled"
2626
# Check what's managing your interface
2727
networkctl status $IFACE
2828

29+
# Check network configs
30+
echo "Checking 10-netplan-eth0.network"
31+
if [ -f /run/systemd/network/10-netplan-eth0.network ]; then
32+
cat /run/systemd/network/10-netplan-eth0.network
33+
# Add UseDNS=false to the DHCP section
34+
cat >> /run/systemd/network/10-netplan-eth0.network << EOF
35+
36+
UseDNS=false
37+
EOF
38+
echo "updated"
39+
cat /run/systemd/network/10-netplan-eth0.network
40+
# Restart systemd-networkd to apply changes
41+
systemctl restart systemd-networkd
42+
elif [ -d /run/systemd/network/ ]; then
43+
echo "ls -la /run/systemd/network/"
44+
ls -la /run/systemd/network/
45+
else
46+
echo "ls -la /run/systemd/"
47+
ls -la /run/systemd/
48+
fi
49+
2950
# Get current DNS server
3051
echo "Current configuration:"
3152
resolvectl status "$IFACE" | grep -E 'Current DNS Server:|DNS Servers:'

0 commit comments

Comments
 (0)