Subject: Re: re-reading /etc/resolv.conf on change
To: NetBSD Userlevel Technical Discussion List <tech-userlevel@NetBSD.ORG>
From: Manuel Bouyer <email@example.com>
Date: 01/04/2004 22:40:42
On Sun, Jan 04, 2004 at 04:23:06PM -0500, Greg A. Woods wrote:
> [ On Sunday, January 4, 2004 at 17:52:20 (+0100), mouss wrote: ]
> > Subject: Re: re-reading /etc/resolv.conf on change
> > Greg A. Woods wrote:
> > >
> > > No, it's not "silly" at all.
> > >
> > > Hacking on the NetBSD resolver "fixes" the problem for a tiny percentage
> > > of real users in the world. In the mean time the problem remains for
> > > all DNS-using applications on all other platforms. Now that's silly.
> > ahem... Can you show me a change in the netbsd sources that solved
> > problems for real users in the world? Sure there are, but at the time
> > they were implemented in netbsd, they weren't available to other users.
> > And this is similar to the current issue. If a good solution is
> > implemented by netbsd, then it may be imported by others.
> You're not looking at the big picture here.
> What Manuel has proposed is a really bad hack to work around an
> acknowledged bug in a very few applications.
No, all applications using the gethostby* interface (but not all of them
suffer from this).
> > No, at start, the resolver library was written so that applications
> > don't have to deal with the name system.
> If you think that's true in the way you seem to mean it then I invite
> you to propose the change to the folks at ISC _first_.
> Meanwhile the standard BIND resolver has _always_ had a proper way to
> deal with this issue: simply call res_init() to reload the resolver's
Well, talking with another developer offline about this, I figured that
the problem isn't in the resolver per se, but in the gethostby* interface
implementation. Note that this interface use the resolver amongst other
methods to retrieve the information (and may not even use the resolver
at all, depending on configuration). Requiring applications to use res_init()
to get up-to-date information from gethostby* is wrong because this mixes
two different interfaces.
So maybe the changes to reread /etc/resolv.conf should be moved to the
gethostby* functions, but it has to be in the library anyway.
> This is not just an issue with NetBSD's own maintenance. This is a
> major problem with confusing application developers as well.
Really ? So they are really confused by solaris I guess.
> > This in turn requires apps to register with dhclient (or with something
> > else) saying "I wanna know when foo changes".
> Absolutely not! No registration is necessary. Only three tiny hooks
> are needed -- one, the res_init() call, in any applications that wish to
All applications want this. Or at last I want it in all applications.
Manuel Bouyer <firstname.lastname@example.org>
NetBSD: 24 ans d'experience feront toujours la difference