You are viewing udrepper

Ulrich Drepper - nscd and DNS TTL [entries|archive|friends|userinfo]
Ulrich Drepper

[ website | My Website ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

nscd and DNS TTL [May. 12th, 2007|10:04 am]
Previous Entry Add to Memories Share Next Entry
Recently some people spread their non-existing knowledge about nscd (Name Service Cache Daemon) by claiming it ignores the TTL (time-to-live) value a DNS server returns. As far as I know this rampant ignorance is especially wide-spread in the ubuntu world. They claim that for this reason one has to run a local, caching DNS server. This is complete nonsense. nscd does handle TTL for a long time now (committed to the public CVS on 2004-9-15). All reasonable requests are handled, i.e., all getaddrinfo requests.

As I have pointed out many times before (here and here and in other places), it is completely unacceptable today to use gethostbyname etc. These functions simply don't work. Which is why I found it unnecessary to make the implementation of nscd more complicated and add more compatiblity and maintenance problems just to fix one of the many problems these interfaces have. Just don't use them and convert all your programs (e.g., I think we've done just that for all of RHEL and Fedora nowadays). Also don't use

  getent hosts some.host


You have to use

  getent ahosts some.host


For all getaddrinfo lookups the TTL value from DNS replies takes precedence over the TTL value from /etc/nscd.conf. The latter is used for services which do not provide a TTL themselves (today all other services).
linkReply

Comments:
From: (Anonymous)
2010-03-02 02:31 pm (UTC)

gethostbyname works now too

(Link)

From the glibc 2.8 changelog:

* nscd caches now all timeouts for DNS entries
Implemented by Ulrich Drepper.

http://sourceware.org/ml/libc-alpha/2008-04/msg00050.html