Subject: Re: re-reading /etc/resolv.conf on change
To: Manuel Bouyer <>
From: Jason Thorpe <>
List: tech-userlevel
Date: 01/06/2004 11:36:53
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII; format=flowed

On Jan 6, 2004, at 11:25 AM, Manuel Bouyer wrote:

> I guess gethostby* has to call the res_* functions if 
> /etc/nsswitch.conf
> tells it to (or maybe it's lower in the nsswitch functions, I don't 
> know).
> My intend it to add this at the same place the resolver routines are
> called.
> But I didn't look at the code yet.

gethostby*() calls a dispatch routine to "backend" functions that 
implement the various methods.

The questions are:

	* How does gethostby*()'s DNS back-end know to re-read resolv.conf?
	  I.e. how does it get the timestamp information about the resolv.conf
	  file for comparisons?

	* Does the user have to do something silly like touch a file
	  unrelated to resolv.conf to trigger the reread?

         -- Jason R. Thorpe <>

content-type: application/pgp-signature; x-mac-type=70674453;
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit

Version: GnuPG v1.2.3 (Darwin)