Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Apr 2008 16:07:39 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        Eygene Ryabinkin <rea-fbsd@codelabs.ru>
Cc:        Poul-Henning Kamp <phk@phk.freebsd.dk>, freebsd-current@freebsd.org
Subject:   Re: [RFC] Automated generation of /etc/resolv.conf from the rc.d script
Message-ID:  <200804251607.39798.jhb@freebsd.org>
In-Reply-To: <vOqYB/k2m7x7iQpW886rPMr1VdY@pxyduK0DwBDzMIlyQjcmQ3WgNdo>
References:  <dEZnki0Fi32EvMrDEnqcgDeNQSc@Bbw9J2Iynx0QjNoWuQ4YSitYS3A> <200804240821.40601.jhb@freebsd.org> <vOqYB/k2m7x7iQpW886rPMr1VdY@pxyduK0DwBDzMIlyQjcmQ3WgNdo>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 25 April 2008 11:53:13 am Eygene Ryabinkin wrote:
> John, good day.
> 
> Thu, Apr 24, 2008 at 08:21:40AM -0400, John Baldwin wrote:
> > 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.
> 
> In the case of DHCP -- yes, I can.  But sometimes I need to specify
> the static entries for the resolv.conf: I am using it when I am
> working in some places where DHCP isn't available, so I am creating
> branched /etc/rc.conf.  And it is useful to have all variables in
> one place.  For my usage, dhclient.conf is not relevant, since I
> am happily taking all that was given me via DHCP.

This was not clear from your earlier e-mails where it seemed that you were 
worried primarily about munging dhclient-script (which would be the DHCP 
case).  Given that you can already manage the DHCP case 
via /etc/dhclient.conf I think adding rc.conf variables to duplicate that 
functionality would be superfluous.

> > 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.
> 
> Yes, it is also the way to go, but, at was said by Poul-Henning,
> nscd is not so smart to know all particulars of DNS, namely -- the
> different TTL values for the different records and zones.

In the case of a laptop (which seems to be what you are doing) where you 
frequently change locations I think nscd's behavior in this instance is 
probably fine.  Note that you can always clear the cache by hand in edge 
cases.

> May be I can integrate the usage of the nscd to the dhclient-script
> and rc.conf?  Is it desirable?

nscd is already well integrated with rc.conf.  Perhaps you could automate the 
clearing of the 'hosts' database (my exit-hooks), but I'm not sure that is 
worth adding all the fuss for since it is a bit of an edge case and it is 
very easy to do this via the exit-hooks.  FWIW, I already adjust my domain 
name (to trim the annoying \000 string you get when you append to the domain 
from a Windows DNS server because it violates the RFC and the dhclient 
authors strict religiously to the RFC rather than add a workaround) in an 
enter hook, so you can easily modify your DNS parameters there already.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200804251607.39798.jhb>