CNAME and TTL

sumsum 2000 sum2hike at gmail.com
Mon Dec 9 11:07:12 UTC 2013


On Fri, Dec 6, 2013 at 6:12 PM, Matus UHLAR - fantomas <uhlar at fantomas.sk>wrote:

> On 06.12.13 15:52, sumsum 2000 wrote:
>
>> I am having only a forward only option in bind configuration.
>> When i dig on some host which has CNAME, the cache contains  a longer TTL
>> for the CNAME than the TTL for the  final resolution of the IP.
>>
>
> Yes, every record has its own TTL, including every record in CNAME chain.
>
>
>  However, in the example below, the CNAME  is  queried again when the TTL
>> for a336.g.akamai.net. is up.
>>
>
> Pardon?
>
>


>
>  I was expecting that the TTL for CNAME will be used from the cache and the
>> lookup will not happen again until the TTL has not expired.
>>
>
> When a name is queried, query is processed always the same way - every name
> of a chain is validated again and missing/expired names are resolved again.
>
> Note that records can removed from memory even without expiring, e.g. when
> memory is full.
>
>
>  Is there a way to avoid additional lookups when the value is already
>> present in the cache for CNAME entries.
>>
>
> not without violating DNS standard.
>
>
>  ;; ANSWER SECTION:
>> emp.bbci.co.uk. 436 IN CNAME emp-live.bbc.net.uk.
>> emp-live.bbc.net.uk. 253 IN CNAME emp.bbci.co.uk.edgesuite.net.
>> emp.bbci.co.uk.edgesuite.net. 3368 IN CNAME a336.g.akamai.net.
>> a336.g.akamai.net. 6 IN A 58.27.124.225
>> a336.g.akamai.net. 6 IN A 58.27.124.200
>>
> What i meant was that,
 when a DNS query is made to emp.bbci.co.uk, the record for it is present
in the cache with TTL of 436. and since it is present, there should not be
any query to the DNS server,the same goes for emp-live.bbc.net.uk and
emp.bbci.co.uk.edgesuite.net

emp.bbci.co.uk. 436 IN CNAME emp-live.bbc.net.uk.
emp-live.bbc.net.uk. 253 IN CNAME emp.bbci.co.uk.edgesuite.net.
emp.bbci.co.uk.edgesuite.net. 3368 IN CNAME a336.g.akamai.net.

 For all these three CNAME, there should not be  any lookup that needs to
be  sent to the DNS server, as they are present in the cache and their TTL
entries have not expired and are present in the cache. Only when it comes
to the last chain a336.g.akamai.net, which expires after TTL of 6 and when
is not present in the cache,  the DNS query for this should be sent for
lookup.

But I see that though the entries for CNAME's are present in the cache,
the look up happens again for the CNAME,

Does it take the minimum TTL  for getting the answer for  the original
entry emp.bbci.co.uk, and ignores the CNAME TTL in the cache.

Is this the correct behavior
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/bind-users/attachments/20131209/8bd0928a/attachment.html>


More information about the bind-users mailing list