First of all, the registrar is never involved in the actual DNS lookup. Registrars (and indeed, registries) are administrative entities outside the scope of the DNS protocol. The actual lookup process looks more like this:
- Ask root servers for
A
ofrweb.stat.ucla.edu.
.- They won't tell you, but they'll point you to servers for
edu.
.
- They won't tell you, but they'll point you to servers for
- Ask the
edu.
servers forA
ofrweb.stat.ucla.edu.
.- They won't tell you, but they'll point you to servers for
ucla.edu.
- They won't tell you, but they'll point you to servers for
- Ask the
ucla.edu
servers forA
ofrweb.stat.ucla.edu.
.stat.ucla.edu
could be a zone that is delegated to yet another set of nameservers, in which case you'll get a referral answer for the third time.- But let't say it's not.
- You get an answer:
rweb.stat.ucla.edu.
hasCNAME
id-86-243.stat.ucla.edu
.
Now you have to start all over again and look up id-86-243.stat.ucla.edu
...
...except that because the target of the CNAME
is inside the same zone as the original record (or, in general, inside any zone that happens to be served from the same nameserver), the nameserver will helpfully give you the A
record for id-86-243.stat.ucla.edu
in the additional section of the DNS response. The resolver will notice this and won't have to run after the A
record itself.
Because resolvers cache answers, many queries can be answered from the cache and don't actually have to be asked every time. Especially the first few steps of the query are all likely to be already cached by the resolver, except immediately after it starts up with a cold cache. So the resolver can probably usually start at step 3 (because it remembers what the nameservers for ucla.edu.
are from its cache) or at least at step 2 (because it remembers what the nameservers for edu.
are) if it doesn't already know the final answer.
So the short answer to your question is yes, using CNAME
makes more work for the resolver and makes the resolution process take longer. But in practice it doesn't matter very much because the resolver's cache is so helpful. And if the CNAME
's target is in the same zone as the CNAME
record itself, it matters even less because of the helpful additional record.