- Linux Administration Cookbook
- Adam K. Dean
- 219字
- 2021-07-02 14:24:32
There's more...
This section obviously made changes using network manager, but that's not to say this is the only way. It's possible to stop the network manager from hijacking and trying to control your DNS.
It's possible to set dns=none in the main section of the NetworkManager.conf file, as detailed in its man page:
rc-manager unmanaged"
Seen in the configuration file at /etc/NetworkManager/NetworkManager.conf, it would look like this:
[main]
#plugins=ifcfg-rh,ibft
dns=none
Restarting NetworkManager at this point would stop it from trying to modify /etc/resolv.conf in the future.
This can be useful if you want something else to manage your system's DNS, even if it's just a script you've written to plonk your DNS servers in /etc/resolv.conf.
DNS is usually done in pairs, and it's a good idea to have a backup DNS server in case the first one goes to pot. Strange things can start to happen when your DNS fails.