Date: 08 Apr 2006 09:48:38 -0400 From: Lowell Gilbert <freebsd-stable-local@be-well.ilk.org> To: stable@freebsd.org Subject: Re: resolver doesn't see resolv.conf changes Message-ID: <447j6041qh.fsf@be-well.ilk.org> In-Reply-To: <4464lki4jg.fsf@be-well.ilk.org> References: <20060405152718.GA1003@roadrunner.q.local> <20060406153938.C78654@orthanc.ca> <20060408083955.GA1041@roadrunner.q.local> <4464lki4jg.fsf@be-well.ilk.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Lowell Gilbert <freebsd-stable-local@be-well.ilk.org> writes: > Ulrich Spoerlein <spoerlein@googlemail.com> writes: > > > Lyndon Nerenberg wrote: > > > The solution is to run a local caching nameserver instance. You should do this anyway, for > > > performance reasons. Add 'named_enable="YES"' to /etc/rc.conf, and modify your > > > /etc/dhclient.conf as follows: > > > > Good idea, but this defeates the hierarchical purpose of DNS. Now my > > caching DNS is always querying the root DNS servers. > > I worked around that by having dhclient-script rewrite the named.conf > (to add a "forwarders" clause), and restart the named. I don't have a > laptop any more, and this doesn't seem to be one of the scripts I keep > around in my web pages, but I could go back to old backups for it... Oh, look I found it. This was with the old (ISC) dhclient, but I think it should work with the current one also. dhclient-enter-hooks looked like this: #!/bin/sh realfile=/etc/namedb/forwarders-list tempfile=${realfile}-temp if [ x"$new_domain_name_servers" != x ]; then echo ' forwarders {' > $realfile for n in $new_domain_name_servers ; do if [ "${n}" != "127.0.0.1" ] ; then echo " ${n};" >> $realfile fi done echo " };" >> $realfile else cp $realfile $tempfile fi if ! diff $realfile $tempfile > /dev/null ; then cpp -P -C /etc/namedb/named.conf > /etc/namedb/named.usable.conf ndc reload fi where as you can probably tell I was using a dhclient.conf that included prepend domain-name-servers 127.0.0.1; in order to get the standard resolv.conf rewriting to put the local nameserver at the top preference. named was configured to use named.usable.conf, which was built from a named.conf that had '#include "forwarders-list"' in its top-level options. It's a bit of a hack, but it lets you use the DHCP-supplied nameserver without any glitches when the address for that server changes under you.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?447j6041qh.fsf>