[Dnsmasq-discuss] dnsmasq for road warriors

sam at sltosis.org sam at sltosis.org
Tue Nov 13 11:13:07 GMT 2012


On Mon, Nov 12, 2012 at 06:11:43PM -0600, richardvoigt at gmail.com wrote:
> On Sun, Nov 11, 2012 at 5:05 PM, /dev/rob0 <rob0 at gmx.co.uk> wrote:
>
> > > On 10/11/2012 15:54, /dev/rob0 wrote:
> > > >Seems to me that dnsmasq is a better nscd replacement, and
> > > >it has a place in mobile computing.
> > > >
> > > ># we use this dnsmasq as this system's own resolver
> > > >no-resolv
> >
> > On Sat, Nov 10, 2012 at 05:46:10PM -0600,
> >    richardvoigt at gmail.com wrote:
> > > no-resolv is doing more harm than good.
> > >
> > > dnsmasq is smart enough to ignore 127.0.0.1 in /etc/resolv.conf
> > > And it will automatically pick up DHCP-assigned DNS servers which
> > > written there.
> >
> > But you don't understand. The point of dnsmasq on a laptop is to
> > serve ONLY that machine and its local processes. /etc/resolv.conf
> > must contain ONLY "nameserver 127.0.0.1". If there are other
> > nameservers listed, the system resolver will be contacting them;
> > possibly getting different results, and ... well, this discussion
> > would not be relevant to the dnsmasq list.
> >
> >
> I don't know where you got this piece of misinformation.  Multiple
> nameserver entries in /etc/resolv.conf work fine, as long as the localhost
> entry (pointing to dnsmasq) comes first.

It will work fine, but the system resolver might end up querying an nameserver
other than  dnsmasq(localhost) which is exactly, if I understood correctly,
what /dev/rob0 wants to avoid.



That said, dnsmasq will poll your alternate resolv.conf for change automatically,
unless requested otherwise (--no-poll), so I see no need to restart it after a
change.

This is actually what I was doing* on my laptop, a custom dhcp client hook will
fill an alternate resolv.conf file : /etc/resolv.conf-dnsmasq (used by dnsmasq),
and ensure /etc/resolv.conf only contains the localhost nameserver with optionnal
supplementary parameters (search,...)

This is obviously usefull for dnsmasq cache and other features (eg: server=//), but
also for some services/daemons which don't poll /etc/resolv.conf for change on
their own(eg: postfix)




More information about the Dnsmasq-discuss mailing list