Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Due to how many servers are involved in my network, I have a hard time keeping them all organized. Some of them don't have static IP's, so I thought it might be nice if I made a domain. On this domain, I could store A records and the IP for each of the servers. This is how I set it up:     A    #ttl 60     A    #ttl 60     A    #ttl 60
# etc

Each of those records have a TTL of 60, in case I need to change an IP quickly, but I don't necessarily want clients connecting every 60 seconds to update. Now let's say I setup my domains to use them, like this:           CNAME   #ttl 3600      CNAME   #ttl 10800       CNAME  #ttl 21600

The TTLs for the CNAMES are higher, so let's say I go to It asks my DNS server for the IP of, and my server returns CNAME Then it asks my server for the IP of, and my server returns

Would it cache the CNAME record for 3600 seconds, and the A record for 60 seconds? Meaning that every 60 seconds it will still ask my server for the IP address?

Or will it cache the see CNAME, get the A, and cache them both for 3600 seconds.

If it's the first, I'll probably have to find another way to manage them, so I'm hoping it's the second, but I'm not sure. Do you know of a better way to keep track of them?

share|improve this question
Can you more clearly define who you mean by 'will it cache'? Unfortunately there are many different resolvers implementations, I would not be surprised at all if you found that both behaviors where true. – Zoredache Apr 15 '11 at 20:10
@zoredache I think what @Ryan want to know is: dns resolvers normally cache the CNAME or the result of a resolved CNAME lookup? – coredump Apr 15 '11 at 20:12
@coredump, yes that's what I meant. – Ryan Pendleton Apr 15 '11 at 20:26
up vote 5 down vote accepted

According to this message on ISC mailing list, CNAME and the record that it points to are cached by resolving name servers (sane resolving name servers) this is done to allow resolvers to be able to optimize the resolving/caching process on the client side.

So, if the CNAME TTL is valid but the A that it points to is invalid, it will only repeat the look up to the pointed record, not the original CNAME (until the CNAME TTL is up too).

share|improve this answer
So if I understand this right, the CNAME record will be requested after it's TTL expires, and the A record it points to will also be requested, but after it's own TTL expires? – Ryan Pendleton Apr 15 '11 at 20:26
Yes. That means, TTL works for CNAME records the same as for other records. – coredump Apr 15 '11 at 20:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.