From owner-freebsd-current@FreeBSD.ORG Thu Apr 24 20:26:49 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D2B7106577B for ; Thu, 24 Apr 2008 20:26:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id A5CB28FC0A for ; Thu, 24 Apr 2008 20:26:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unknown [208.65.91.234]) by elvis.mu.org (Postfix) with ESMTP id 2B0521A4D84; Thu, 24 Apr 2008 13:26:48 -0700 (PDT) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m3OKQS9r044310; Thu, 24 Apr 2008 16:26:36 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Ulrich Spoerlein Date: Thu, 24 Apr 2008 16:05:27 -0400 User-Agent: KMail/1.9.7 References: <200804240821.40601.jhb@freebsd.org> <20080424185129.GC1672@roadrunner.spoerlein.net> In-Reply-To: <20080424185129.GC1672@roadrunner.spoerlein.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804241605.27332.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 24 Apr 2008 16:26:36 -0400 (EDT) X-Virus-Scanned: ClamAV 0.91.2/6926/Thu Apr 24 14:23:40 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Poul-Henning Kamp , freebsd-current@freebsd.org Subject: Re: [RFC] Automated generation of /etc/resolv.conf from the rc.d script X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 20:26:49 -0000 On Thursday 24 April 2008 02:51:29 pm Ulrich Spoerlein wrote: > On Thu, 24.04.2008 at 08:21:40 -0400, John Baldwin wrote: > > On Monday 14 April 2008 11:44:13 am Eygene Ryabinkin wrote: > > > At last, I did the needed modifications: patches against 7.0 from > > > yesterday, April 13th, are attached. The first one enables the > > > creation of /etc/resolv.conf from rc.conf variables and the second > > > brings the named forwarders rewriting using values obtained via > > > DHCP. I had touched dhclient-script, but it was really needed, > > > because it is not good to have simular functionality in /etc/rc.d/resolv > > > and in the dhclient-script. > > > > > > I decided not to cope with modifications of /etc/namedb/named.conf, > > > but rather to create other file, /etc/namedb/named.forwarders.conf, > > > that should be included from the main configuration. > > > > > > I am living for two days with this configuration (DHCP + local named > > > instance) and no problems were spotted yet. > > > > > > Testing and feedback are more than welcome. > > > > You can already override the domain name and DNS servers (including either > > overriding, providing a default, or prepending or appending to the list) via > > setings in /etc/dhclient.conf, so I don't think new rc.conf variables for > > that would be warranted. Updating named.conf to forward is a neat idea. > > Howver, on my laptop on HEAD I've ended up just running nscd instead of a > > local DNS server and doing a 'nscd -I hosts' when I get a new lease to flush > > the host cache. When I get to my laptop I'll post my bits of > > dhclient-exit-hooks and dhclient.conf to make this work. > > People always forget, that a computer can get an IP address via ppp(8), > too. That's why I'm (still) running a local bind and have hooks to > update the forwarders + reload in dhclient-enter-hooks *AND* ppp.linkup. nscd will work fine with ppp as well. :) You would just need to invoke nscd -I hosts when you get a new lease there as well. A lot easier than rewriting named.conf and reloading named. > I'd say that nscd(8) is the way to go for 7.0 and up (though I still > haven't set it up for myself ....) Yes, and new patches would likely be going into 8.0 where nscd is already present. :) Setting up nscd for caching DNS is literally the 2 lines I mentioned in my previous e-mail: - nscd_enable="YES" (rc.conf) (plus manual start via /etc/rc.d/nscd if you don't want to reboot) - add "cache" for the "hosts" line in /etc/nsswitch.conf Having dhclient auto-invalidate the cache on a new DHCP lease is an optional feature. :) -- John Baldwin