Subject: Re: Adding TTL information to gethostbyname() and friends
To: None <itojun@iijlab.net>
From: Ian Lance Taylor <ian@airs.com>
List: tech-net
Date: 06/02/2003 10:13:26
itojun@iijlab.net writes:

> >One of the long standing drawbacks to the BSD sockets API is that
> >there is no reasonable way to get the TTL of a DNS entry.
> 
> 	pulling in getrrsetbyname() is more appropriate.  get*info and
> 	gethostby* are fairly standardized API so we don't wannt to be
> 	different from others.

getrrsetbyname() is a different function which serves a different
purpose.  It only reads DNS information.  It would not be correct for
a browser to call getrrsetbyname() instead of gethostbyname(), since
the latter also reads /etc/hosts and NIS information.

A browser needs an interface which reads DNS, NIS, and /etc/hosts
information as configured by the administrator.  That is the
gethostbyname() interface.

>	get*info and
> 	gethostby* are fairly standardized API so we don't wannt to be
> 	different from others.

As I mentioned originally, it would be fine with me to introduce new
functions similar to gethostbyname().  The change to getaddrinfo() is
strictly upward compatible, but if necessary it would be possible to
introduce a new interface there as well.

Ian