Difference Between CName and A Record
CName vs. A Record
Web sites are stored in locations that are uniquely identified by a group of numbers, which we know as IP addresses; but to access these sites, we usually type in their corresponding domain names, that are easier to remember. To get the correct IP address, your browser will contact a Domain Name Server, or DNS, and query its database for the IP address. An A Record is a type of resource record that directly points to the IP address. A CName, or Canonical Name record, is also a resource record, but it does not point to an IP address. Instead, it points to another domain address.
Although the point of having a DNS is to get the IP address of a given domain, a CName record is used to identify multiple domain names that point to the same IP address. There are a lot of uses for CName records, but the most prominent is when using multiple services that are running on the same machine or host. An FTP server will have a domain name of ftp.example.com, while an http server will use www.example.com. Despite this, they will be using the same IP address. Therefore, a CName entry will also exist in the database for ftp.example.com, that points to www.example.com. When looking for the IP address of ftp.example.com, the CName record is encountered, and the query is restarted using the new domain name. This procedure is repeated until an A Record is found that provides the IP address being searched. This way, only a single A Record that points to the right IP address is needed.
A CName record is very useful, but it can also create a problem that is systemic to its design. Given the example domain names provided above, it is possible that two CName records exist, where ftp points to www for the first, and the reverse for the second entry. As the query is restarted once a CName entry is found, having those two entries will result in an infinite loop that could crash the server. A Records do not have this problem, as they do not point to another domain name.
Summary:
1. A CName points to a domain name, while an A Record points to an IPv4 address.
2. Finding a CName record will spawn a new search, while finding an A Record will not.
3. Improper CName records can result in an endless loop, but A Records do not.
- Difference Between Sony Cybershot S Series and W Series - December 22, 2012
- Difference Between Samsung Galaxy S3 and iPhone 5 - December 21, 2012
- Difference Between Samsung Galaxy S2 (Galaxy S II) and Galaxy S 4G - December 20, 2012
Search DifferenceBetween.net :
Email This Post : If you like this article or our site. Please spread the word. Share it with your friends/family.
I totally disagree with the author’s opinion, “A CName record is very useful, but it can also create a problem that is systemic to its design.”
A CName record cannot create a problem. What can possibly create a problem is when someone creates an improper record. The person or entity that created the record is what poses the problem, not the CName record.
Thank you for the clarification of the differences. I do agree with Big though, it does seem like the problem is from a user, by creating a wrong record, which I could see as a simple mistake from someone that doesn’t know too much about this, hence I would recommend to ask support from your registrar, or a trusted acquaintance.
Why would anyone make a www CName that points to http://ftp.domain.com?
I appreciate the author’s concern, but like the other two commentators it seems more like he’s trying to scare people away from using CName records, when really it should be “Hey, here’s a fun fact: you can actually have CNames reference each other, which if you then performed a lookup on one it would create an infinite loop that could crash your DNS server. So, you know, don’t.”