If a CNAME
has a TTL of 1 hour that points to an A
record with a TTL of 1 minute, will someone who looks up this CNAME
have the entire result cached for 1 hour, or will it will keep having to lookup the A record every 1 minute?
If a CNAME
has a TTL of 1 hour that points to an A
record with a TTL of 1 minute, will someone who looks up this CNAME
have the entire result cached for 1 hour, or will it will keep having to lookup the A record every 1 minute?
The CNAME should cache for an hour (the alias value), but when the corresponding A is looked up, it will only cache for a total of 1 minute. You're talking about two independent records that are handled separately.
Using Google's public DNS servers, the expiration of the A record causes a query of the CNAME record as well, even if the CNAME has a longer TTL.
We painfully experienced that because the DNS provider charged us for DNS queries. The CNAME hosted by the DNS provider had a TTL of several days. The TTL of the A record was hosted on Windows Azure with a TTL of 10 seconds. The DNS provider charged us for 7.5 million queries.
You can see that the CNAME and subsequent record have different TTLs by using dig..
To show that you get both the CNAME and the what it is pointed at is returned in a single request to a recursive server.