18

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.

7
  • Disabling dnsmasq is unlikely to help you: its strong point is to make this work automatically in most cases. Commented 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 127.0.1.1 value. So why it doesn't do its job then?
    – humkins
    Commented Jan 27, 2016 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. Commented Jan 27, 2016 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?
    – humkins
    Commented Jan 27, 2016 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.). Commented Jan 27, 2016 at 12:27

1 Answer 1

19

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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .