12.04: How to add local details to dnsmasq config

Paul Smith paul at mad-scientist.net
Mon Jun 4 00:59:31 UTC 2012


On Sun, 2012-06-03 at 15:31 +0300, Marius Gedminas wrote:
> Here are the two dnsmasq instances that are running:
> 
> $ ps $(pgrep dnsmasq)|cat
>   PID TTY      STAT   TIME COMMAND
>  1523 ?        S      0:00 /usr/sbin/dnsmasq -u libvirt-dnsmasq --strict-order --bind-interfaces --pid-file=/var/run/libvirt/network/default.pid --conf-file= --except-interface lo --listen-address 192.168.122.1 --dhcp-range 192.168.122.2,192.168.122.254 --dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases --dhcp-lease-max=253 --dhcp-no-override
>  3723 ?        S      0:03 /usr/sbin/dnsmasq -x /var/run/dnsmasq/dnsmasq.pid -u dnsmasq -r /var/run/dnsmasq/resolv.conf -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new

The first one is for your VM environment.  The second one is something
else; this might be the default configuration for dnsmasq in
Ubuntu/Debian but it's not the one that is configured as part of the new
resolvconf/dnsmasq setup for Ubuntu 12.04.

In Ubuntu 12.04 there are two packages: dnsmasq-base and dnsmasq.  The
former provides ONLY the dnsmasq binary but no sysv init scripts or
default config files, etc.  It's just the bare bones, used by
networkmanager/resolvconf/etc. for the 12.04 setup with its own
configuration.

Then if you install the "dnsmasq" package you get all the extra sysv
init setup, etc. that you would have had from the previous releases.

> > > > How can I add/remove config from the local DNS configuration?
> > > 
> > > dnsmasq supposedly has a DBus control protocol of some kind, but I
> > > haven't been able to find documentation for it.
> > 
> > I don't think this will help.  I want the config file to be modified so
> > that the configuration is static and persists beyond daemon restarts.
> 
> It seems to me that you could sudo apt-get install dnsmasq and then
> add files under /etc/dnsmasq.d/ to have additional static and persistent
> configuration.

Yes, I can definitely completely replace the default configuration of
dnsmasq etc. with my own, static implementation.  But that's not my
question.  The question is, how can I ENHANCE the default configuration
so that it's still available for those features that support it, and yet
still use my own customized setups for things (like my proprietary VPN
solution) which do not support it.

I can't use dnsmasq.conf in the default 12.04 setup: there's a dnsmasq
running which is already bound to the default port and listening for
local requests on 127.0.0.1 and it uses its own separate configuration
file /var/run/nm-dns-dnsmasq.conf and does not use any other
configuration.  Hence, my question of how to add my own content to that
separate configuration file.





More information about the ubuntu-users mailing list