Created
June 9, 2024 07:56
-
-
Save mykola2312/07169ad9c85598800b1d316fcfb4b16b to your computer and use it in GitHub Desktop.
Make NetworkManager use proper DNS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
dns="1.1.1.1 8.8.8.8 8.8.4.4" | |
active_network=$(nmcli con show --active | awk 'NR==2 {print $2}') | |
nmcli connection modify uuid $active_network ipv4.ignore-auto-dns yes | |
nmcli connection modify uuid $active_network ipv4.dns "$dns" | |
echo "DNS fixed for ${active_network}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment