caching only and /etc/resolv.conf - new user

Kevin Darcy kcd at daimlerchrysler.com
Sat May 25 00:16:41 UTC 2002


Brian O'Gorman wrote:

> Why would I need to have an entry in the /etc/resolv.conf on the machine
> which is running DNS as follows
>
> nameserver 127.0.0.1
>
> Yes,  I know this the local loopback IP, but what good does it do in
> this file? The O'Reilly book  in chapter 6
> says it is for hosts that don't understand the zero address.

If that's *all* you have in /etc/resolv.conf, then you're probably wasting
your time. You could just omit /etc/resolv.conf completely, your resolver
will probably then just default to using 0.0.0.0 as the nameservers
address, and assuming your networking stack can deal with 0.0.0.0,
everything should work fine.

If you have an /etc/resolv.conf for other reasons (e.g. because you want a
"domain" directive or multiple "nameserver" directives for redundancy),
then it's up to you whether you want to use 127.0.0.1 to refer to the local
nameserver or 0.0.0.0 (although if your system can't handle 0.0.0.0, the
choice is pretty simple :-). Note that the O'Reilly book warns against
using 127.0.0.1 when you have multiple "nameserver" directives, because of
an obscure networking bug (that I've personally never experienced).

> Do other UNIX machines on my network need a local loopback entry their
> /etc/resolv.conf, or may they just point to the machine running DNS?

They should only point to loopback if they are running a caching nameserver
of their own. You should give serious consideration to implementing this,
i.e. every machine runs its own caching nameserver, because of the
query-performance, autonomy and/or load-spreading benefits that it
provides. The only downsides are a) you have to turn this on for every box
(often caching-only nameservice is not the default for a Unix/Linux
install), b) a local caching nameserver consumes extra resources (primarily
memory), and c) depending on your TTL settings you may find that changes
don't propagate as quickly as you might like because "stale" data is cached
everywhere.


- Kevin





More information about the bind-users mailing list