File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 17
17
18
18
echo " Using interface: $IFACE "
19
19
20
+ # Check if NetworkManager is running
21
+ systemctl is-active NetworkManager || echo " NetworkManager disabled"
22
+
23
+ # Check if systemd-networkd is running
24
+ systemctl is-active systemd-networkd || echo " systemd-networkd disabled"
25
+
26
+ # Check what's managing your interface
27
+ networkctl status eth0
28
+
20
29
# Get current DNS server
21
30
echo " Current configuration:"
22
31
resolvectl status " $IFACE " | grep -E ' Current DNS Server:|DNS Servers:'
@@ -31,12 +40,19 @@ echo "Setting DNS to $LOCAL_DNS for $IFACE (with fallback to $ORIGINAL_DNS)"
31
40
resolvectl revert " $IFACE "
32
41
33
42
# Set DNS with local server FIRST (this makes it primary)
34
- resolvectl dns " $IFACE " " $LOCAL_DNS " " $ORIGINAL_DNS "
43
+ # resolvectl dns "$IFACE" "$LOCAL_DNS" "$ORIGINAL_DNS"
44
+ resolvectl dns " $IFACE " " $LOCAL_DNS "
45
+
46
+ # Flush DNS cache
47
+ resolvectl flush-caches
35
48
36
49
# Confirm setup
37
50
echo -e " \nUpdated configuration:"
38
51
resolvectl status
39
52
53
+ # Check again what's managing your interface
54
+ networkctl status eth0
55
+
40
56
echo -e " \nTesting DNS resolution..."
41
57
42
58
# Test if our local DNS is working
You can’t perform that action at this time.
0 commit comments