<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></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).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> bind-users-bounces@lists.isc.org [mailto:bind-users-bounces@lists.isc.org]
<b>On Behalf Of </b>Steve Arntzen<br>
<b>Sent:</b> Wednesday, October 21, 2015 4:33 PM<br>
<b>To:</b> bind-users<br>
<b>Subject:</b> Why two lookups for a CNAME?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></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.<o:p></o:p></p>
<p><o:p> </o: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?<o:p></o:p></p>
<p><o:p> </o:p></p>
<p>Using dig, I find play.google.com is a CNAME for play.l.google.com.<o:p></o:p></p>
<p><o:p> </o: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.<o:p></o:p></p>
<p><o:p> </o:p></p>
<p>Named then makes a second request to resolve the A record.<o:p></o:p></p>
<p><o:p> </o:p></p>
<p>Thanks in advance,<o:p></o:p></p>
<p><o:p> </o:p></p>
<p>Steve.<o:p></o:p></p>
</div>
</body>
</html>