<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"><head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
 </head><body><p>Thank you Jeff.</p><p><br></p><p>I was just wondering why, when the IP comes back with the first response, does named ask again?</p><p><br></p><p>Is it just being literal (like me) or will it not always get the IP in the first request (depending on the DNS server)?</p><p><br></p><p>Steve.</p><p><br></p><p><br></p><p><br></p><p><br></p><blockquote type="cite"><!-- [if gte mso 9]> --><!-- <![endif] --><!-- [if gte mso 9]> --><!-- <![endif] --> On October 21, 2015 at 3:42 PM "Lightner, Jeff" <JLightner@dsservices.com> wrote:<br><br><div class="WordSection1"><p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;">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.</span></p><p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"> </span></p><p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;">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).</span></p><p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"> </span></p><p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;">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.</span></p><p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"> </span></p><p class="MsoNormal"><span style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"> </span></p><div><div style="border: none; border-top: solid #B5C4DF 1.0pt; padding: 3.0pt 0in 0in 0in;"><p class="MsoNormal"><strong><span style="font-size: 10.0pt; font-family: 'Tahoma','sans-serif';">From:</span></strong><span style="font-size: 10.0pt; font-family: 'Tahoma','sans-serif';"> bind-users-bounces@lists.isc.org [mailto:bind-users-bounces@lists.isc.org] <strong>On Behalf Of </strong>Steve Arntzen<br> <strong>Sent:</strong> Wednesday, October 21, 2015 4:33 PM<br> <strong>To:</strong> bind-users<br> <strong>Subject:</strong> Why two lookups for a CNAME?</span></p></div></div><p class="MsoNormal"> </p><p>I'm sure there's a good, simple reason for this, I just can't seem to find the answer searching on the Internet.</p><p> </p><p>Why does named perform a lookup for the A record when its IP is returned with the CNAME in the first answer?</p><p> </p><p>Using dig, I find play.google.com is a CNAME for play.l.google.com.</p><p> </p><p>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.</p><p> </p><p>Named then makes a second request to resolve the A record.</p><p> </p><p>Thanks in advance,</p><p> </p><p>Steve.</p></div></blockquote><p><br> </p></body></html>