13

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

nameserver 127.0.1.1

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)
init(1)───dnsmasq(3015,libvirt-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. – Gilles Jan 24 '16 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 127.0.1.1 value. So why it doesn't do its job then? – gumkins Jan 27 '16 at 1:40
  • With dnsmasq, /etc/resolv.conf should always contain nameserver 127.0.0.1, 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. – Gilles Jan 27 '16 at 10:21
  • Can you please then just let me know why it is 127.0.1.1 (not 127.0.0.1) and where it is configured? – gumkins Jan 27 '16 at 12:13
  • Anything beginning with 127. points to the local machine. I don't know why 127.0.1.1 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.). – Gilles Jan 27 '16 at 12:27
15

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! – Fx32 Jul 3 '18 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.