Subject: Re: Adding TTL information to gethostbyname() and friends
To: NetBSD Networking Technical Discussion List <tech-net@NetBSD.ORG>
From: Ian Lance Taylor <ian@airs.com>
List: tech-net
Date: 06/04/2003 14:17:44
"Greg A. Woods" <woods@weird.com> writes:

> The problem is that your proposed hack is making the actual problem
> worse, not better.  Your proposal condones their bad behaviour.  Your
> proposal effectively forces additional work onto every application
> author.  You are ignoring fundamental design goals and limitations.
> Your proposal requires that protocol levels be violated.

I'm willing to believe that you believe that except for that part
about ``your proposal effectively forces additional work onto every
application author.''  It certainly does not.  Any application author
is free to rely on the efficient local DNS caching which you will
arrange to provide.

> Please keep in mind that the particular scenarios where any application
> level DNS caching can have any benefit whatsoever are rapidly
> disappearing.  It is quite forseable that in the not too distant future
> everyone with enough bandwidth to effectively use any application doing
> DNS caching now will also have a low-latency connection; while those
> with limited bandwidth will be using variant services (e.g. WAP) where
> DNS caching in the client application will also be unnecessary (and
> often unthinkable).

Someday, perhaps.  As the author of UUCP, I still get my fair share of
e-mail from people around the world coping with slow connections.

> > I understand your point about how it would be better if every system
> > ran a correct DNS cache.  I know that.  But even so, that does not
> > explain why it is better to hide the TTL.
> 
> It should be obvious.  From an application's point of view the DNS is
> supposed to be a black box -- i.e. the TTL information that is used by
> the DNS to implement cache consistency is private internal information
> not to be made available to applications for any purpose.  Hiding the
> TTL is supposed to help force application authors into relying on the
> caching inherent in the underlying DNS implementation.  Don't give them
> information they don't need.  Don't give them information that's
> internal to the implementation.  Don't ask them to re-implement features
> that are already _required_ to be implemented internally in the DNS.
> 
> If the DNS is not being correctly implemented and deployed as required
> by RFC 1123 then let us try much harder to fix that problem, not just
> hack around it.

I assume then that you feel that functions like res_query(),
res_search(), and getrrsetbyname() should be removed from libc.  After
all, they might reveal information to the application which should be
kept secret.

Ian