Skip to main content

Command Palette

Search for a command to run...

DNS Record Types Explained

Updated
6 min read
DNS Record Types Explained

Today everyone is connected to internet, whenver we try to visit any website, or access any data on internet it feels instant and effortless. Type a website name, press Enter and it opens, but behind this simple action there is a system quietly working continously to make sure our browser reaches the correct place. That system is called DNS.

In this article we will break down DNS in the simplest way possible, using everyday examples and clear explanations, so that it would be helpful for a beginner too.

How Does a Browser Know Where a Website Lives?

When you type www.website_name.com into your browser and press Enter, something magical seems to happen, The browser window get refreshed and requested website just opens.

But have you ever wondered that :

How does the browser know where that website actually lives ?
How does it finds the correct server among millions on the internet ?

The answer in one word is DNS, known as Domain Name System.


DNS: The Phonebook of the Internet

The easiest way to understand DNS is to think of it as the phonebook of the internet.

In our phonebook, we save a person’s contact number using their name. When we want to call someone, we don’t search for their phone number directly. Instead, we search for their name, and the phonebook gives us the number.

The internet works in a very similar way. Websites have human-friendly names like google.com or github.com, but computers do not understand names. They understand numbers called IP addresses, such as 192.168.1.1.

When we try to open a website, DNS translates the website name into its IP address. Once the browser gets this IP address, it knows exactly which server to connect to and can load the website.

Just like this:

  • You search a contact name —> you get a phone number

  • Browser searches a domain name —> it gets an IP address

Without DNS, we would have to remember numeric IP addresses for every website we want to visit, which would be nearly impossible.


Why Are DNS Records Needed?

So far, we understood that DNS helps convert a website name into an IP address.

But in reality, a domain is used for much more than just opening a website. A single domain can host a website, send and receive emails, connect with third party services, and prove ownership for security purposes.

All these taska need different kinds of information, so DNS does not store everything in one place, instead it uses various DNS records. Each DNS record has a specific purpose and is used to solve a specific problem.

Few major DNS record types are like this :

  • Nameserver (NS) record

  • A record

  • AAAA record

  • CNAME record

  • Mail Exchange (MX) record

  • TXT record

Think of DNS record as clear instructions that tell the internet how a domain should behave.

This is why DNS Records exist, to organize different responsibilities of a domain in a clean and understandable way.


What is an NS Record?

A Name Server record, also known as NS record, tells the internet that who is responsible for managing the DNS information of a domain.

Before anything else happens, the internet first need to know where the official DNS records are stored for a domain. The NS server answers this question, it points to the DNS servers that contain the correct and trusted information about the domain.

Let’s think of a NS record like a head office, if someone wants any kind of official information they are directed to head office first.

If the NS record is incorrect, nothing will work properly because the internet do not know where to look for the DNS settings for the domain.


What is an A Record?

An A record is one of the most important DNS records. It connects a domain name to an IPv4 address, which is the actual address of the Server, where the website is hosted.

Whenever browser requests a website, it always needs an IP address to connect with that website. The A record provides that address. Once the browser gets the IP address from the A record, it can directly communicate with the server and load the website.

Without an A record, a website cannot open because the browser never finds the server’s location


What is an AAAA Record?

An AAAA record works in the same way as an A record, but instead of pointing to an IPv4 address, it points to an IPv6 address.

IPv4 and IPv6

IPv4 and IPv6 both are the internet protocols that assign unique numerical addresses to devices for network communication, known as IP addresses.

IPv4 is the older version and looks like numbers seperated by dots, such as 192.168.1.1, because the internet grew very quickly, the number of available IPv4 addresses started running out. To solve this problem IPv6 was introduced, IPv6 provides a much larger number of unique addresses that looks longer and more complex, for example 2409:40c4:288:80ea:c1d9:8a6b:4029:53d9.

Today both IPv4 and IPv6 are used together to make sure the internet continues to grow smoothly.


What is a CNAME Record?

A CNAME record allows one domain name to point to another domain name instead of poinitng directly to an IP adress. It acts like an alias or nickname.

For example www.example.com can point to example.com. This way, both names lead to the same website without repeating the IP address in multiple places. If the server’s IP address changes, you only need to update it in one place.

Simple difference between A record and CNAME record (for beginners) :

  • An A record points directly to an IP address

  • A CNAME record points to another domain name


What is an MX Record?

An MX record, short for Mail Exchange record, is used for email delivery.

When someone sends an email to an address like hello@website.com, mail servers need to know where to deliver that email. MX records tell the internet which mail servers are responsible for receiving emails for the domain.

MX records can also include priority values. These values help decide which mail server should be used first and which one should act as a backup if the main server is unavailable. Without MX records, emails sent to a domain would never reach the inbox.


What Is a TXT Record?

A TXT record is used to store extra information about a domain. It does not directly control website loading or email delivery, but it plays a very important role in verification and security.

TXT records are commonly used to prove domain ownership, connect services like Google Search Console, and protect email systems from spam and misuse. When a service asks you to add a TXT record, it is usually trying to confirm that you are the real owner of the domain.

TXT records are often invisible to users, but they are essential for trust and safety on the internet.


How All DNS Records Work Together

In a real-world setup, a single domain usually uses multiple DNS records at the same time. Each record has a specific responsibility, and together they ensure everything works smoothly.

  • NS records define who controls the domain’s DNS

  • A or AAAA records point to the website server

  • CNAME records manage alternative domain names like www

  • MX records handle email delivery

  • TXT records support verification and security

DNS works like a team, where every record plays its role to keep websites accessible and emails working correctly.