DNS records simplified

Naeem Hadiq
Oct 30, 2019 · 3 min read

Confused by A, CNAME, ALIAS and all the sort of records??

Getting confused is easy. Let's try to go to the base of it and explain them one by one.

Domain Name System (DNS) is the way search engines translate your website to the server address. which means translating a domain such as example.com to its IP address to communicate to.

Image for post
Image for post

When you register a domain there are multiple types of Domain Name Service Records you can set up.

Each of these records has a Type, a Hostname and a Value

  • ”Types” are Predefined
  • “Host” represents the root(@) or a sub domain (www,test etc)
  • “Value” is an IP or Web address or a text value.
Image for post
Image for post

A Record

Maps a subdomain to its corresponding IPv4 address.

It is most commonly used at the root, and tells the browser where example.com lives.

AAAA Record

Its the IPv6 equivalent of an A Record.

CNAME

Maps a subdomain to another domain.

This can be a subdomain in the same site(www to root) or a totally different website such as an AWS Service or a Heroku instance where you run your app.

Image for post
Image for post

CNAME however has a major disadvantage. Once a CNAME is defined for a subdomain no other records can be defined for the same subdomain.

CNAME implemented at root i.e(@) means you no longer can use any other records with the root domain.

ALIAS or ANAME

It is the workaround to a CNAME for subdomains that require other records to exist.

ALIAS or ANAME is exactly like a CNAME except it is a non-standard DNS Type and allows other records such as TXT & MX to exist.

TXT Record

It is a record that can pass extra information to a computer reading this DNS Record. It can be utilized to prove you own a domain as it can only be set up by the person with root-level/Owner level access to the configurator.

Image for post
Image for post

MX Record

It is a Mail eXchange Record used to specify that other servers such as Google or Microsoft exchange are used to manage and handle your emails.

MX records are unique and have options to point to multiple servers depending on the priority of each independent record.

Image for post
Image for post

The above said is the most commonly used DNS records the other types of records that exist are very rarely or never used in normal day to day use cases.

For each of the above records, we also specify a TTL (Time To Live) it basically tells the server, how long to cache DNS Values.

TTL is one of the reasons why new domain records take time to propagate and be valid.

DNS Servers, ISP’s and even system cache DNS records and keep serving old values till the TTL runs out and the server fetches the new records.

Innovation Incubator

We publish various articles on the latest technologies

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store