Can DNS Caching Be Disabled for a Single Domain (BIND)?

3

1

I have a BIND server (CentOS 6) on my local subnet handing my DNS requests. I also have a domain which points to my GoDaddy VPS. I would like to configure my BIND server so that it won't cache any requests for my domain. This is so when I update my domain's DNS records I don't have to flush the DNS cache on my server each time to see if my changes are working.

Basically each time I request my domain, I would like my BIND server to request the IP from the GoDaddy DNS servers. Requests for any other domain I would like it to cache normally.

Thanks for any help.

Brack

Posted 2014-05-18T17:28:39.173

Reputation: 369

Answers

1

Set the TTL on all your records to 5 seconds. Or even 1 second if you like. Then they won't be cached for very long at all. Just don't use 0 for the TTL, it causes strange behavior with some resolver code.

milli

Posted 2014-05-18T17:28:39.173

Reputation: 1 682

Thats a good idea. I wonder if it is possible to do per-domain TTL. I'll look into this. – Brack – 2014-05-22T14:22:02.517

There is a default TTL per zone (per-domain as you say) that all record added to the zone inherit if they are not added with a specific TTL. – milli – 2014-05-31T14:49:47.107

0

If you have 9.3 or greater you can use rndc to flush the cache for a single domain.

From DNS and Bind:

BIND 9.3.0 will support flushing all of the records attached to a particular domain name with rndc flushname. For example:

rndc flushname google.com

Nidal

Posted 2014-05-18T17:28:39.173

Reputation: 353

Thanks for the reply. This would work but I'd have to run it each time, or set up a task to run it automatically, right? It wouldn't work automatically each time I request the domain? – Brack – 2014-05-21T21:21:02.767