Skip to main content

Command Palette

Search for a command to run...

DNS Record Types Explained

Published
3 min read
DNS Record Types Explained

Hey Everyone,

In the previous blog, I talked about what is DNS. If you haven’t checked it out yet, give it a read for a better understanding.

But in short DNS stands for Domain Name System which is like a phonebook of internet. That helps to find the IP for the website we entered.

Humans remember names → www.google.com

Computers use numbers → 42.20.10.14 (IP address)

When you entered some website like www.google.com on the browser. It doesn’t know the address of the website so it needs to ask. All the process of finding the address of website is handled by DNS.

What is DNS Records and why are they needed?

DNS needs to answer some questions like:

  • Where is the website hosted?

  • Who manages this domain?

  • Where should emails be delivered?

  • Is this domain verified for a service? etc….

And to answer those above questions DNS Records are required.

Each record solve one problem. lets start

NS Record

NS Stands for Name Server.

It is a type of DNS record which gives the information of the servers responsible for this domain’s DNS.

DNS is distributed, No single server knows everything. NS records tell the internet who owns the source of truth.

A Record

A stands for address

It provide answer to this question what is the IPV4 address off this domain?

That means it will return the IPV4 address of the website.

www.example.com -> 26.05.2.1

Your browser needs this record to connect to the server.

AAAA Record

AAAA is the IPv6 version of the A record.

As IPV4 addresses ran out of the internet that why IPV6 exists.

example.com → 2606:2800:220:1:248:1893:25c8:1946

A domain can have both A and AAAA record.

CNAME Record

CNAME stands for canonical name.

It is like a alias point this domain to another domain.

www.dev.example.com -> www.example.com

Many got confused with A and CNAME record why worry when i am here

A record will only return the IPV4 address

CNAME record points to another domain, it will never return an IP address

MX Record

MX stands for Mail Exchange.

This record answers to this question:

Where should email for this domain will be delivered?

example.com → mail.google.com

TXT Record

TXT record stores all the plain text information

They are commonly used for:

  • Domain Ownership Verification

  • Email Security

  • Third Party Service Validation

How all DNS records work together for one website

Let’s take a simple domain: example.com

Here’s how DNS records work together:

  1. NS Record: It will tell where DNS data lives like on cloudflare, google.

  2. A/AAAA Record: It will then tell where the website server is.

  3. CNAME Record: It will only point to another domain if it was entered.

  4. MX Record: It will tell where the mail for this domain will be delivered

  5. TXT Record: It will tell information like domain owners , email security etc…

Clearing some common confusion

NS vs MX

NS → Who manages this domain?

MX→ where should the mail for this domain will be delivered?

A vs AAAA

A→ Will return IPV4 address

AAAA→ Will return IPV6 address

Domain can have both records.

DNS isn’t complicated.

It’s just organised.


And now, you know What are DNS Records and why are they needed.

If you have any doubt or want to connect feel free to drop a comment — I’d be happy to help.

Thanks for reading, and see you in the next blog!

Peace ✌️ and Happy Learning!