The Basics of DNS Records (A, CNAME, MX)
Domain Name System (DNS) is an internet service that basically translates all domain names into IP addresses. The internet is actually based on IP addresses, but since we humans prefer easier-to-remember terms, DNS was created. Anytime you type a domain name into the address bar (ie google.com), DNS will change the name to the specific IP address that is assigned to that domain.
|| FOR EXAMPLE: www.bbc.co.uk can also be accessed through its IP address of 212.58.253.68 ||
If you’re a website owner, there are a few DNS records of which you may want to have a rudimentary knowledge. The 3 most likely records that you may encounter are the A, MX, and CNAME Records.
A Record
Address (or A) records simply point a host/domain name to an IP address. Often there is more than one IP address to the same host. This can be done by using multiple A Records. This is most often used when there is more than one server hosting a website.
Syntax you may encounter in A records:
bbc.co.uk IN A 212.58.253.68
IN = Internet
A = Address record
CNAME Record
CNames, or Canonical Names, are used to assign an alias to an existing host or domain name. There should always be an A record for the host with its original Canonical Name. Any other names point to the original Canonical Name.
Syntax you may encounter in CNAME records:
www.bbc.co.uk. IN CNAME bbc.co.uk
IN = Internet
CNAME = CNAME record
The above example shows that www.bbc.co.uk is the same as bbc.co.uk. If you type bbc.co.uk in the address bar, it will resolve to www.bbc.co.uk.
MX Record
Main Exchanger is a service record that tells where emails for a domain are to be sent. There can, of course, be multiple MX records for any given domain. This is for the purpose of redundancy. In the event that one server fails, a backup server(s) will still have the emails delivered.
The Priority number assigned to an MX record says which server should be the first one to have the emails delivered, as well as which server will be next in the queue in case the first server is not functioning properly. Whichever server has the lowest priority number will be the default for receiving emails. The next lowest priority number will be the first backup for email deliveries.
Syntax you may encounter in MX records:
bbc.co.uk. IN MX 10 mail.example.ex-host.cc
IN = Internet
MX = Mail Exchanger record
If you have subdomains, wildcards can be used as well.
Example: *.bbc.co.uk IN MX 10 mail.example.ex-host.cc shows that all mail from the domain AND subdomains will be delivered to mail.example.ex-host.cc (with a Priority number of 10).
So, those are the basics to some important DNS records. DNS can be elusive to many, but knowing the basics will keep your head from spinning if you do have to deal with an issue related to DNS!




