From: Jaime Di Cristina on
On Mon, Aug 09, 2010 at 08:19:59AM -0700, peasthope(a) wrote:
> Jaime,
> You put me back on track. Thanks!
> From: Jaime Di Cristina <jaime.dc(a)>
> Date: Sun, 08 Aug 2010 23:32:13 -0400
> > I use dnsmasq on OpenWrt. There the information of the DNS
> > servers is stored on /tmp/ I don't know where is the
> > equivalent location on a Debian installation of dnsmasq.

I'm glad I could help.

> Debian doesn't have /tmp/ but here is the
> answer.
> peter(a)joule:~$ ps aux | grep dnsmasq
> dnsmasq 5278 0.0 0.0 2328 592 ? S Aug08 0:00 /usr/sbin/dnsma
> sq -u dnsmasq -r /var/run/dnsmasq/resolv.conf
> peter 6774 0.0 0.0 3120 728 pts/0 S+ 07:56 0:00 grep dnsmasq
> >From the manual.
> -r, --resolv-file=<file>
> Read the IP addresses of the upstream nameservers from <file>,
> instead of /etc/resolv.conf. For the format of this file see
> resolv.conf(5) the only lines relevant to dnsmasq are nameserver
> ones. Dnsmasq can be told to poll more than one resolv.conf
> file, the first file name specified overrides the default, sub-
> sequent ones add to the list. This is only allowed when polling;
> the file with the currently latest modification time is the one
> used.

Good one. I suppose this could also have been found in the relevant init script.

> And finally.
> peter(a)joule:~$ cat /var/run/dnsmasq/resolv.conf
> nameserver 64.59.160.[]
> nameserver 64.59.160.[]
> Last field omitted from the addresses in respect of the ISP.
> Strangely, the manual, FILES section, lists /etc/resolv.conf
> but not /var/run/dnsmasq/resolv.conf.
> I should have thought to check ps yesterday. All that
> is left in this story is to understand why dnsmasq
> uses /var/run/dnsmasq/resolv.conf rather than
> /etc/resolv.conf. Appears to be specific to Debian;
> not in other distributions. Is this a consequence of
> Debian policy?

/etc/resolv.conf points to the localhost so that other programs are
directed to the dnsmasq cache instead of going directly to your real
DNS servers. Since dnsmasq takes care of sending queries to upstream
servers there is no need for other programs to be aware of those
servers. It is the same in OpenWrt. If you use dig without tracing
(from the machine running dnsmasq) you'll see that the localhost
appears as your DNS server.


To UNSUBSCRIBE, email to debian-user-REQUEST(a)
with a subject of "unsubscribe". Trouble? Contact listmaster(a)