There is a part of GNU libc called “nscd”, the name service caching daemon. It can cache username, group and host information as configured in
/etc/nscd.conf. However, it really only caches responses to syscalls like
gethostbyname() (and others as listed in
man nscd). This means that it can cache DNS information, but without knowing about DNS TTL values. It also will be bypassed for hostname lookups UNLESS
gethostbyname() is called and that function is old and busted. The new hotness is
getaddrinfo() as described:
Point is, you DO need a local caching DNS server to handle DNS requests, e.g. http://ubuntu.wordpress.com/2006/08/02/local-dns-cache-for-faster-browsing/ and you can’t just use nscd as some of the comments suggest.