[TriLUG] Re: Caching DNS quickstart Was: RR DNS?

John Franklin franklin at elfie.org
Sun Jul 14 14:20:31 EDT 2002


On Sun, Jul 14, 2002 at 01:11:53PM -0400, Jon Carnes wrote:
> First, you only need the 127.0.0.1 entry in your /etc/resolv.conf - as long 
> as your named daemon is running.  The other entries should actually be 
> added to your /etc/named.conf file in the "forwarders" section.  I guess 
> it's nice to have an alternative if you named daemon breaks down, so its 
> cool to put other entries after 127.0.0.1 in your /etc/resolv.conf.
> 
> Second, a grep of /etc/network-scripts/* for "resolv" points to "ifup-post" 
> as being the source of all know evil in the universe.  Well, perhaps that 
> is an exaggeration, but if you want your DHCP app to leave your 
> /etc/resolv.conf file alone, you might try editing that file or somehow 
> setting the environment variable "$RESOLV_MODS" to "no" (as that tells the 
> script not to muck with resolve.conf!).

The quick-and-dirty solution is to modify the script that creates the
resolv.conf file.  In NetBSD, it's /etc/dhclient-script, in RH7.1(2,3?)
it's /etc/sysconf/network-scripts/ifup-post.  What you want to do is
modify it to add "nameserver 127.0.0.1" before it adds the other
nameservers it finds.

For RH that means changing line 78 from:

    cat $tr > /etc/resolv.conf

to

    echo "nameserver 127.0.0.1" > /etc/resolv.conf
    cat $tr >> /etc/resolv.conf


There probably should be a better way to configure this out of the box.

jf
-- 
John Franklin
franklin at elfie.org
ICBM: 35°43'56"N 78°53'27"W



More information about the TriLUG mailing list