Mobile app version of vmapp.org
Login or Join
Ravi8258870

: Understanding CNAME and NS in DNS I'm trying to learn the different types in DNS (A, CNAME, NS etc). I do understand what they is used for, but the way I see it, CNAME could be used whenever

@Ravi8258870

Posted in: #Cname #Dns #Server

I'm trying to learn the different types in DNS (A, CNAME, NS etc).

I do understand what they is used for, but the way I see it, CNAME could be used whenever NS is used, or am I wrong?

For instance:

(dns.mysite.com, 1.2.3.4, A)
(mysite.com, dns.mysite.com, CNAME)


Would it matter if I used CNAME of NS here?

Also, a second question, am I right in assuming that top level domain (TDL) DNS servers don't have any CNAME records?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Ravi8258870

1 Comments

Sorted by latest first Latest Oldest Best

 

@Cody1181609

No, CNAME and NS are quite different.

CNAME associates an alias with a canonical ("true") name. So in your example, dns.mysite.com would be an alias for canonical/true name mysite.com, and all DNS queries for dns.mysite.com would be referred to (ie, retried with) mysite.com.

NS records identify an authoritative name server for a domain (more correctly, a DNS zone). They tell a DNS query where to look for authoritative detail about a domain (zone). Typically, unless you are setting up name server infrastructure, your domain registrar will provide correct NS details for your domain (typically, a few name servers for redundancy, each controlled by your registrar, such as ns1.registrar.com, ns2.registrar.com).

For subdomains which will resolve to the same address, you do have a choice between A and CNAME records. The practical difference between A and CNAME records is that CNAME will cause an additional lookup (to resolve the alias to the canonical name) which is not incurred with a direct A record. So there is a slight performance penalty on lookups if you use CNAME records rather than individual A records for your subdomains.

The root zone file does not contain any CNAME records, but that's not because it can't, but that it doesn't need to. It mainly contain NS and address (A & AAAA) records for top level domains, for country-code top level domains (and, more recently, for all those new/extended TLDs like .auction).

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme