Linux – Configuring dnsmasq in Mint/Ubuntu/Debian

dnsmasqlinux-mintnetworkmanager

I have a computer with multiple ethernet ports – one goes out to the internet, the rest connects to other devices to give them internet connectivity. The DHCP service is provided by dnsmasq. The computer also has a couple samba shares that are shared with the "internal" interfaces only. I thought this was all a pretty vanilla setup.

In Mint 18, all this simply worked without disruption.

Updating to Mint 18.1 introduced some weirdness in NetworkManager, where dnsmasq comes up like this:


ps -ef | grep dnsm
nobody 5099 5080 0 16:55 ? 00:00:00 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/var/run/NetworkManager/dnsmasq.pid --listen-address=127.0.1.1 --cache-size=0 --conf-file=/dev/null --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d

The problem is the part that says "–conf-file=/dev/null" as this seems to prevent dsnmasq from actually reading the configuration file in /etc/NetworkManager/dnsmasq.d

I can 'systemctl stop NetworkManager' followed by a 'killall -9 dnsmasq' and then re-issue the dnsmasq "by hand" – but that's extremely ugly at best (and costs me all the other NetworkManager functionality).

Sifting through all the various files in /etc/NetworkManager and /usr/lib/NetworkManager and such I cannot find the place where 'conf-file=/dev/null' is specified, so I'm guessing it's a default that needs to be overridden somewhere/somehow but I don't know how or where – "man NetworkManager.conf" isn't really helping.

Best Answer

NM passes the conf-file to prevent dnsmasq to load the default configuration file.

Note however:

--conf-dir=/etc/NetworkManager/dnsmasq.d 
Related Question