Ubuntu uses a DNSMasq instance for Network Manager starting in 12.04 - how can I disable it?
3 Answers
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!
-
3Our 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. May 12, 2016 at 22:56
-
On Debian Bullseye my configuration required that I restart NetworkManager this way; systemctl restart NetworkManager YMMV– jeremiahOct 3, 2022 at 14:08
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.