File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 3030 sudo rm /etc/resolv.conf
3131 sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
3232
33+ # Create config to force wlan0 to use network DNS settings
34+ local wlan0_config_file=" /etc/systemd/network/25-wlan0.network"
35+
36+ if [ ! -f " $wlan0_config_file " ]; then
37+ echo " Creating wlan0 DNS priority configuration..."
38+ sudo tee " $wlan0_config_file " > /dev/null << 'EOF '
39+ [Match]
40+ Name=wlan0
41+
42+ [Network]
43+ DHCP=yes
44+
45+ [DHCPv4]
46+ UseDNS=yes
47+
48+ [Network]
49+ Domains=~.
50+ EOF
51+ fi
52+
3353 sudo systemctl enable --now systemd-resolved.service
3454}
3555
@@ -70,5 +90,11 @@ function check(){
7090 return
7191 fi
7292
93+ # Check if wlan0 config file exists
94+ if [ ! -f " /etc/systemd/network/25-wlan0.network" ]; then
95+ show_error " Systemd" " /etc/systemd/network/25-wlan0.network does not exist."
96+ return
97+ fi
98+
7399 show_success " Systemd and systemd-resolved are properly configured."
74100}
You can’t perform that action at this time.
0 commit comments