12.04: How to add local details to dnsmasq config

Paul Smith paul at mad-scientist.net
Fri Jun 1 16:18:38 UTC 2012


On Fri, 2012-06-01 at 10:24 +0300, Marius Gedminas wrote:
> On Thu, May 31, 2012 at 10:23:59PM -0400, Paul Smith wrote:
> > I have a 3rd party VPN tool which is most decidedly NOT integrated with
> > Network Manager, and I need to add appropriate extra setup to the
> > dnsmasq configuration to handle the DNS forwarding for that environment.
> > I used to manage all this myself by hand so I'm quite aware of what
> > needs to be done and how it all works.
> > 
> > However, I don't know how to add extra content to the dnsmasq
> > configuration network-manager uses.  I can see that network-manager
> > starts a dnsmasq server that listens on 127.0.0.1 (good stuff) and that
> > the configuration file is /var/run/nm-dns-dnsmasq.conf which I assume is
> > being auto-generated by network manager.
> 
> Interesting.  I'm on 12.04 as well, and I also use a VPN tool not
> integrated with NetworkManager (openvpn --config /path/to/config-file
> --route-nopull --route x.y.0.0 255.255.0.0).  I don't have a
> /var/run/nm-dns-dnsmasq.conf on my system, even though I most definitely
> have dnsmasq running. 

Did you do a clean install or an upgrade?  I did a clean install (first
time since 2009 or so when I bought my current desktop!)  Perhaps if you
upgrade, the new NM/dnsmasq/resolvconf config is not added.

Also note if you add KVM (virtualization) that will start its own
dnsmasq, to provide network services to the virtual machines.  You can
tell which one is doing what by examining the command line arguments.

> > That's all good stuff, BUT I need a way to add my own set of
> > configuration to that nm-dns-dnsmasq.conf file, preferably dynamically
> > (so I can script the bring-up and bring-down of my proprietary VPN and
> > get it added and removed at the appropriate times).
> > 
> > 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.

> A static configuration works well enough for me.

Well sure, and as I mentioned above it's worked well for me for a couple
of years as well (with a very complex configuration: I actually have to
use TWO different VPNs at the same time, both with extensive internal
DNS domains).  But now that Ubuntu is trying to solve this problem
natively I was hoping to have the ability to integrate into that instead
of rolling my own.

Any ideas?





More information about the ubuntu-users mailing list