Last Updated:

How to stop network-manger updating /etc/resolv.conf on Linux

Based on metho4 in this article

I have a fairly common problem - my centos 7 machines are using network-manager and the DNS in /etc/resolv.conf is managed by it, so changes are lost every time

the method describes a procedure which is missing a component

  1. perform the procedure linked above.
    Basically add an entry "dns=none" to the file "/etc/NetworkManager/NetworkManager.conf"
  2. Reboot your computer. This will make the new setting kick in.
    This is the step that is missing in the linked procudeure
  3. now edit your /etc/resolv.conf by adding "nameserver <ip address>
    Example: nameserver 8.8.8.8
  4. This setting will remain after each reboot

 

enjoy Admining!

Comments