From owner-freebsd-stable@FreeBSD.ORG Sat Apr 8 13:48:40 2006 Return-Path: X-Original-To: stable@freebsd.org Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2FE2C16A403 for ; Sat, 8 Apr 2006 13:48:40 +0000 (UTC) (envelope-from freebsd-stable-local@be-well.ilk.org) Received: from mail5.sea5.speakeasy.net (mail5.sea5.speakeasy.net [69.17.117.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id A24CF43D49 for ; Sat, 8 Apr 2006 13:48:39 +0000 (GMT) (envelope-from freebsd-stable-local@be-well.ilk.org) Received: (qmail 31658 invoked from network); 8 Apr 2006 13:48:39 -0000 Received: from dsl092-078-145.bos1.dsl.speakeasy.net (HELO be-well.ilk.org) ([66.92.78.145]) (envelope-sender ) by mail5.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 8 Apr 2006 13:48:39 -0000 Received: by be-well.ilk.org (Postfix, from userid 1147) id BB23028425; Sat, 8 Apr 2006 09:48:38 -0400 (EDT) Sender: lowell@be-well.ilk.org To: stable@freebsd.org References: <20060405152718.GA1003@roadrunner.q.local> <20060406153938.C78654@orthanc.ca> <20060408083955.GA1041@roadrunner.q.local> <4464lki4jg.fsf@be-well.ilk.org> From: Lowell Gilbert Date: 08 Apr 2006 09:48:38 -0400 In-Reply-To: <4464lki4jg.fsf@be-well.ilk.org> Message-ID: <447j6041qh.fsf@be-well.ilk.org> Lines: 57 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Subject: Re: resolver doesn't see resolv.conf changes X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Apr 2006 13:48:40 -0000 Lowell Gilbert writes: > Ulrich Spoerlein 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.