I'm on Ubuntu 16.04 Xenial and Network Manager started dnsmasq
for me with these options:
~/ ps awux|grep dnsmasq
nobody 2649 0.0 0.0 54488 3588 ? S Mai23 0: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 --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d
I'd like dnsmasq
to read/use the /etc/hosts
file as well, which it currently doesn't seem to, because of the option --no-hosts
.
How do I change the startup options, that Network Manager uses to invoke dnsmasq?
All
dnsmasq
configuration files you add into/etc/NetworkManager/dnsmasq.d/
are passed todnsmasq
. Just check it with the command:I get this kind of result (notice the
--conf-dir
parameter):So you could just create a file e.g.
/etc/NetworkManager/dnsmasq.d/my-hosts
containing the declaration:in order to use
/etc/hosts
(see doc). But becausednsmasq
starts also with--no-hosts
this might determinednsmasq
to still ignore/etc/hosts
so you could just create a hard link to it e.g.:then change the declaration to: