With my ubuntu 16.04, my /etc/resolv.conf change every system start

cat /etc/resolv.conf  

Network-manager have the correct dns name server
I removed bind9 and all related packages.
No special config on rc folders nor rc.local
No dns-nameserver options with /etc/network/interfaces.

I missed something? What app can change this file automatically?

  • Do you use DHCP?
    – HBruijn
    Apr 6, 2017 at 11:45
  • Perhaps this could answer your question: askubuntu.com/questions/627899/…
    – chloesoe
    Apr 6, 2017 at 11:46
  • Yes I use DHCP Thanks, the solution is to comment #dns=dnsmask from network-manager.conf
    – M. BY
    Apr 11, 2017 at 14:26

3 Answers 3


I can't remember when this started, but resolv.conf is a system generated file.

Anything (more specifically, static options from previous resolv.conf's) that you want adding to that should be put in /etc/resolvconf/resolv.conf.d/base.


Make sure resolvconf service is running, enable it:

sudo systemctl start resolvconf.service

then enter this one:

sudo nano /etc/resolvconf/resolv.conf.d/head

then add/change the nameservers you want and save, and then modify the resolv.conf and close.

remember to set your network-manager dns to what you've set in resolv.conf


Do you use DHCP?

  • Does maybe your DHCP server send wrong nameserver pointers?
  • Do you have a custom dhcp.conf that uses it's own nameserver config and ignores the DHCP server?

If you don't use DHCP:

  • Thank you, I am using network-manager (iface wlan with dhcp) But when displaying dns with network-manager show interface informations: the correct ones are showing.
    – M. BY
    Apr 6, 2017 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.