[RFC] Automated generation of /etc/resolv.conf from the rc.d
script
John Baldwin
jhb at freebsd.org
Fri Apr 25 20:45:44 UTC 2008
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
More information about the freebsd-current
mailing list