From time to time when I'm switching from eth0 to wlan0 (or vice versa) interface domain name resolving breaks and /etc/resolv.conf contains


I commented #dns=dnsmasq in /etc/NetworkManager/NetworkManager.conf and restarted network manager with restart network-manager. But this didn't help.

Then I found that dnsmasq process is not a child of NetworkManager

# pstree -spu $(pidof dnsmasq)

I'm not sure why it is running. Can it be related to VirtualBox? I don't want it to touch resolve.conf. How to disable it?

My system is Linux Mint 17 Qiana.

  • Disabling dnsmasq is unlikely to help you: its strong point is to make this work automatically in most cases. Jan 24, 2016 at 21:34
  • That is exactly what I want: each time I'm switching between interfaces or between networks/routers it to work without manual corrections. Let's assume that dnsmasq is a good software and it knows why it overwrites /etc/resolv.conf content with nameserver value. So why it doesn't do its job then?
    – humkins
    Jan 27, 2016 at 1:40
  • With dnsmasq, /etc/resolv.conf should always contain nameserver, because it handles all DNS requests. With NetworkManager+dnsmasq, what normally happens is that NM sends messages to dnsmasq over dbus to tell it when connections change. Why isn't it doing it? That's a question you could ask on this site — with all necessary explanations about your network setup. Jan 27, 2016 at 10:21
  • Can you please then just let me know why it is (not and where it is configured?
    – humkins
    Jan 27, 2016 at 12:13
  • Anything beginning with 127. points to the local machine. I don't know why is used here. Anyway, if you want help with dnsmasq, you need to ask a new question where you explain your setup, including why VirtualBox is involved at all (is your system running in a VM? Or is it a VM host? What kind of VM configurations have you made? etc.). Jan 27, 2016 at 12:27

1 Answer 1


On Linux Mint, dnsmasq is installed to cache DNS queries, and thereby speed up your Internet experience. The first part of disabling it is to change the configuration in /etc/NetworkManager/NetworkManager.conf by commenting out dns=dnsmasq.

sudo sed -i 's/^dns=dnsmasq/#&/' /etc/NetworkManager/NetworkManager.conf

Next, you have to restart both the network-manager and networking services.

sudo service network-manager restart
sudo service networking restart

Since my laptop is really tight on RAM, I made sure the dnsmasq service stopped. For some reason, this wasn't done automatically with the service restarts. I suspect there was a more elegant way to stop it than this, but I got tired of looking when I couldn't find an init file and SIGHUP didn't work.

sudo killall dnsmasq

Personally, I had to disable dnsmasq because network manager and dnsmasq don't like me wiring in a second connection to an otherwise disconnected router.

  • 3
    Small warning: restarting network-manager causes the Cinnamon desktop to crash into fallback mode. Be sure to save your work!
    – okdewit
    Jul 3, 2018 at 21:23

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.