From owner-freebsd-current@FreeBSD.ORG Thu Apr 24 13:07:04 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 B71621065670 for ; Thu, 24 Apr 2008 13:07:04 +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 C2DC88FC12 for ; Thu, 24 Apr 2008 13:07:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (unknown [208.65.91.234]) by elvis.mu.org (Postfix) with ESMTP id 77B741A4D8D; Thu, 24 Apr 2008 06:07:03 -0700 (PDT) From: John Baldwin To: freebsd-current@freebsd.org Date: Thu, 24 Apr 2008 08:21:40 -0400 User-Agent: KMail/1.9.7 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804240821.40601.jhb@freebsd.org> Cc: Poul-Henning Kamp 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 13:07:04 -0000 On Monday 14 April 2008 11:44:13 am Eygene Ryabinkin wrote: > Poul-Henning, good day. > > Fri, Dec 14, 2007 at 02:07:00PM +0300, Eygene Ryabinkin wrote: > > Fri, Dec 14, 2007 at 10:57:38AM +0000, Poul-Henning Kamp wrote: > > > In message , Eygene Ryabinkin writes: > > > >> It should be possible to run a local named even when we run DHCP, > > > >> and it shuld be an option, to have it automatically forward to the > > > >> DNS servers we learn from DHCP. > > > > > > > >This can be achieved with the script /etc/dhclient-exit-hooks that > > > >will create the file with named 'forwarders' clause [...] > > > > > > Yes, I know that, but I would like to see it controllable from rc.conf > > > like the rest of our network configuration. > > > > OK, since running local DNS instance is a neat idea, I will try to > > draft the modifications for the dhclient-exit-hooks, as I described > > in the previous mail. > > 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. -- John Baldwin