[CentOS] bind and caching-nameserver

Tue May 10 14:40:21 UTC 2005
Paul Heinlein <heinlein at madboa.com>

On Tue, 10 May 2005, Mark Quitoriano wrote:

> well that's my problem with bind. once i cut myself to the internet 
> i can't resolve all domain. i did this as a test i ping google.com 
> first while i am connected to the net and then i disconnect my cable 
> and try to ping it again but it can't resolve google.com anymore, my 
> resolve.conf is "nameserver 127.0.0.1", and i don't know how to 
> configure bind to cache domain's ip addressess at least 1 day or so.

IMO, it's a feature, not a bug, that bind honors the TTL settings of 
remote name servers. Google, for instance, tends to assign unusually 
short TTLs to its DNS entries:

$ dig www.google.com +noall +answer
www.google.com.         900     IN      CNAME   www.l.google.com.
www.l.google.com.       300     IN      A       66.102.7.147
www.l.google.com.       300     IN      A       66.102.7.99
www.l.google.com.       300     IN      A       66.102.7.104

Google is telling remote name servers to cache the 'www.google.com' 
entry (which is just a CNAME) for 15 minutes and the actual addresses 
of its web servers for only 5 minutes.

That's why bind won't cache it for an entire day.

I suppose that you could hack named so that it ignores remote TTL 
requests, but my hunch is that you won't get any sympathy when you 
complain that now your name server has begun misbehaving... :-)

--Paul Heinlein <heinlein at madboa.com>