Running Xubuntu 16.04 here. My problem is that dnsmasq, as started by NetworkManager, ignores the dnsmasq.conf files in /etc/dnsmasq, /etc/NetworkManager/dnsmasq.d, and /etc/NetworkManager/dnsmasq-shared.d. Instead, NetworkManager starts dnsmasq with this command:

9949 ?        S      0:00 /usr/sbin/dnsmasq --conf-file --no-hosts --keep-in-foreground --bind-interfaces --except-interface=lo --clear-on-reload --strict-order --listen-address= --dhcp-range=,,60m --dhcp-option=option:router, --dhcp-lease-max=50 --pid-file=/var/run/nm-dnsmasq-wlan1.pid --conf-dir=/etc/NetworkManager/dnsmasq-shared.d

I can find nowhere on my system where an address range of,,60m is specified.

Where is this coming from???

  • Do you have the file /etc/dnsmasq.conf or /etc/dnsmasq? Looks like the manual expects the former. A restart would be necessary of the service after a change as well. – 111--- Aug 8 '17 at 16:41
  • Yup, I have /etc/dnsmasq.conf. And /etc/NetworkManager/dnsmasq.d/dnsmasq.conf. Both are ignored. And yes, there have been several system restarts. – Bob Salnick Aug 8 '17 at 22:36
  • I believe that the problems is caused by the "--conf-file (blank)" directive being issued by NetworkManager when it starts dnsmasq. How can I remove this directive from the command line that NetworkManager is issuing? Apparently a test that NetworkManager is performing is not working properly: strings /usr/sbin/NetworkManager|grep conf_file conf_file != NULL – Bob Salnick Sep 17 '17 at 19:15
  • On my system dnsmasq is not being started by init, but by NetworkManager. NetworkManager (a binary) is generating the command internally and (I believe) blowing it when checking for the definition of an environment variable called 'conf_file'. – Bob Salnick Oct 7 '17 at 15:41
  • Exporting "conf_file=dnsmasq.conf" in the NetworkManager startup script didn't work. Here's the two relevant lines from syslog: Oct 6 11:19:44 localhost dnsmasq-dhcp[13278]: DHCP, IP range --, lease time 12h Oct 6 11:19:44 localhost dnsmasq-dhcp[13278]: DHCP, IP range --, lease time 1h Apparently, the environment variable was detected and used to produce the first line, which was immediately undone by the second line. – Bob Salnick Oct 7 '17 at 15:41

OK, got it. direct from the source, file : nm-dnsmasq-manager.c

/* dnsmasq may read from it's default config file location, which if that location is a valid config file, it will combine with the options here and cause undesirable side-effects. Like sending bogus IP addresses as the gateway or whatever. So tell dnsmasq not to use any config file at all. */

NetworkManager is jealous of dnsmasq configuration values, and will not allow outside interference with them. NetworkManager internally builds and issues the command line that starts dnsmasq, and in doing so, includes the --conf-file (blank) directive, which prevents use of any user or system-supplied dnsmasq configuration file.

  • Explain it to me like I’m five years old — how does this answer the question? Do not respond in comments; edit your answer to make it clearer and more complete. – G-Man Says 'Reinstate Monica' Oct 10 '17 at 16:24

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.