Why two lookups for a CNAME?

Steve Arntzen isc at arntzen.us
Wed Oct 21 21:00:21 UTC 2015


Thank you Jeff.


I was just wondering why, when the IP comes back with the first response, does
named ask again?


Is it just being literal (like me) or will it not always get the IP in the first
request (depending on the DNS server)?


Steve.





> On October 21, 2015 at 3:42 PM "Lightner, Jeff" <JLightner at dsservices.com>
> wrote:
> 
> 
>     Because the purpose of DNS primarily is to equate a name with an IP as
> applications talk to IPs not to names.   When you have a CNAME you’re equating
> one name with another name.   That other name then has to be looked up so the
> application knows what IP access.
> 
>      
> 
>     This saves time if you have multiple CNAMES to the same A record in that
> when you update DNS you only have to update that one A record.  You don’t have
> to use CNAMES to go to same IP – you could make each record an A record
> pointing to the same IP.   You’d then have to be sure you updated all the A
> records using that IP if you decided to change it to something else later
> (e.g. if you changed ISPs).
> 
>      
> 
>     Obviously there is a small performance cost in CNAMES which is why you
> don’t want to have a CNAME to  another CNAME because that results in 3
> lookups.   For most applications the single CNAME isn’t an issue but on
> occasion it is so you go the A record route instead.
> 
>      
> 
>      
> 
>     From: bind-users-bounces at lists.isc.org
> [mailto:bind-users-bounces at lists.isc.org] On Behalf Of Steve Arntzen
>     Sent: Wednesday, October 21, 2015 4:33 PM
>     To: bind-users
>     Subject: Why two lookups for a CNAME?
> 
>      
> 
>     I'm sure there's a good, simple reason for this, I just can't seem to find
> the answer searching on the Internet.
> 
>      
> 
>     Why does named perform a lookup for the A record when its IP is returned
> with the CNAME in the first answer?
> 
>      
> 
>     Using dig, I find play.google.com is a CNAME for play.l.google.com.
> 
>      
> 
>     When asked to resolve it, named will first look for play.google.com.  The
> result will include the CNAME and the IP of the A record.
> 
>      
> 
>     Named then makes a second request to resolve the A record.
> 
>      
> 
>     Thanks in advance,
> 
>      
> 
>     Steve.
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/bind-users/attachments/20151021/73aef299/attachment.html>


More information about the bind-users mailing list