nslookup, dig, and host when name server is down

Denys Vlasenko vda.linux at googlemail.com
Sun Apr 12 13:43:00 UTC 2009


On Sunday 12 April 2009 15:04, Ming-Ching Tiew wrote:
> > It is not a correct design. /etc/resolv.conf should point
> > to
> > DNS server all "normal" programs use, and in this case it
> > should
> > be the address of them machine running dnsmasq, in your
> > case 127.0.0.1
> > (in fact, in this case /etc/resolv.conf is optional,
> > 127.0.0.1
> > is the default address if /etc/resolv.conf is missing.
> > But uclibc wasn't doing that correctly too).
> > 
> > dnsmasq, on the other hand, is not a "normal" program in
> > this case.
> > It shouldn't try to use /etc/resolv.conf, but should have
> > separate config.
> 
> FYI, I tested this above configuration, and it did not work as expected.
> 
> This is my test configuration :-
> 
> 1. Setup a name server on machine A.
> 
> 2. Setup 'dnsmasq' on a uclibc-based machine B where it is
>    configured to lookup /etc/resolv.conf2, inside which
>    there is one name server, which is specified as 
>    machine A's IP.
> 
> 3. Have /etc/resolv.conf which has 127.0.0.1 as the
>    only name server.
> 
> 4. Run a client on machine B, say 'nslookup' or 'dig' to lookup
>    some hosts which has been configured for name server in machine A.
> 
>    This resolution works perfectly. All names configured in machine A
>    can be resolved in machine B.
> 
> 5. Kill the name server on machine A.
> 
> 6. Immediately 'nslookup' and 'dig' get blocked for a long
>    time, and eventually it displayed timeout error.
> 
> Version: uclibc 0.9.30-rc2
>          dnsmasq 2.47
> 
> I am puzzled. There is absolutely no caching behaviour at all.

This basically means that dnsmasq is not caching queries.

Since I and not an expert on dnsmasq (I actually learned
about its existence from this thread), I do not know whether
it is a bug in dnsmasq, or maybe it is not supposed to do
any (long term, more than a few seconds) caching,
only more clever selection of DNS servers and "dead server"
detection if more than one is configured.

You need to consult dnsmasq documentation.

> Restoring the name server on machine B will also restore DNS 
> service in machine B. 
> 
> Instead of killing name server on machine A, I also tested
> bring down the network on machine A ( which is the more likely
> occurance ), the same blocking and timeout behaviour happens again.

--
vda


More information about the busybox mailing list