Override Network Manager DNS
2022-03-17 by: Mike
Sometimes, you just want to set DNS Servers the old fashioned way, but Linux's Network Manager won't let you.
Two ways to fix this:
1. Edit NetworkManager.conf
Edit/etc/networkmanager/NetworkManager.conf
setting dns=none
Then edit /etc/resolv.conf
to be whatever you want.. NetworkManager will leave it alone.
Am currently preferring/using this one, for no particular reasons.
2. Symlink
Seems at least in my testing, Network Manager will not override a symlink. This is RedHat's official solution, but works on Armbian/Debian. YMMV. Create a file like/etc/resolv.manual.conf
with what you need. like:
nameserver 8.8.8.8 nameserver 192.168.1.2Then remove the current /etc/resolv.conf and symlink it.
rm /etc/resolv.conf ln -s /etc/resolv.manual.conf /etc/resolv.conf