Ubuntu uses a DNSMasq instance for Network Manager starting in 12.04 - how can I disable it?

up vote 38 down vote accepted

Edit /etc/NetworkManager/NetworkManager.conf with the following command:

gksu gedit /etc/NetworkManager/NetworkManager.conf

Enter in your password when prompted.

Comment out the line dns=dnsmasq, so it looks like this:

#dns=dnsmasq

and then restart Network Manager with

sudo restart network-manager
# if you get /com/ubuntu/upstart: Connection refused, try:
sudo service network-manager restart

Ta-da! You're all set!

  • 3
    Our entire office is cloud hosted. Some stuff is on a private cloud in AWS with a VPN. dnsmasq was getting in the way of correct DNS resolution when on the VPN. I am the only linux user in the office and everyone else was mac. When I looked at a friends settings on his mac that's when it occurred to me what must be happing. I shut this off and life is good. – Christian Bongiorno May 12 '16 at 22:56

If this still does not work for you, like was my case with Ubuntu 16.10. Then check who is using this port with:

lsof -i :53

And if you for example have "systemd-r", then you have to stop the service with:

sudo service systemd-resolved stop

I also had this problem, but I'm on Ubuntu 16.04, so the original solution did not work. However, this page had the solution.

Add DNSStubListener=no in /etc/systemd/resolved.conf and then restart the systemd-resolved service. Now, the built-in dnsmasq should not start automatically.

You will also need to make sure that dns=dnsmasq is commented out in /etc/NetworkManager/NetworkManager.conf, like the previous answer specifies.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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