Traditional DNS Howto - Page 5
Up to now we have used the domain names centralsoft.org, server1.centralsoft.org, and ns0.centralsoft.org, but we did not specify anywhere to which IP addresses these domains should point to. That's where A records come into play. A records are the most important DNS records; with them you can create host addresses. Let's create our first A record:
This means that centralsoft.org has the IP address 184.108.40.206. Remember my hint about the '.'? You can also write
which means exactly the same.
Now in a browser you are used to typing www.centralsoft.org instead of centralsoft.org, aren't you? www.centralsoft.org is technically totally different from centralsoft.org, but obviously you expect to see the same web site for both. Therefore we create this record:
which is the same as
Finally we specify server1.centralsoft.org and ns0.centralsoft.org:
ns0.centralsoft.org points to a different IP address which makes sense because it is our secondary nameserver which should be on a different system in case our primary nameserver goes down.
CNAME is short for "canonical name", you can think of it as an alias to an A record. For example,
means, ftp.centralsoft.org is an alias for www.centralsoft.org, so ftp.centralsoft.org points to the same machine as www.centralsoft.org.
A CNAME must always point to an A record; a CNAME must not point to another CNAME! In addition to that, you must not use CNAME records for MX and SOA records. For example,
is not allowed!
The usage of CNAMEs has its pros and cons. I can hear you say "If the usage of CNAME records has that many restrictions, why don't we always use A records?" That's true, but imagine you have hundreds of machine names as A records, pointing to the same IP address, and now you move the server to another data center where it is assigned a different IP address. You'd have to update every single A record. If you had just one A record and all other records were CNAMEs, you'd just have to update one A record...