Skip to main content

Command Palette

Search for a command to run...

DNS Record Types Explained

Understanding the Different Types of DNS Records

Updated
6 min read
DNS Record Types Explained
G

A web development learner and tech enthusiast, documenting my journey into modern web development. I share what I learn, write practical coding tips, and publish beginner-friendly blogs on programming concepts and tools.

When we type a website name like google.com into a browser and press Enter, the page opens almost instantly. It feels simple and natural. But behind this simple action, something very important happens first.

Before a browser can load any website, it must answer one basic question:

“Where does this website live on the internet?”

Browsers do not understand website names. They understand numbers. The system that helps convert human friendly names into machine friendly numbers is called DNS.

In this article, we will understand DNS from the ground up, using simple ideas and real life examples, without going deep into technical jargon.

What DNS Is (in very simple terms)

DNS stands for Domain Name System.

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

In real life, we save contact names like “Mom” or “Office” in our phone. Behind those names are actual phone numbers. We never dial the numbers directly because names are easier to remember.

The internet works in a similar way.

  • Websites have names like example.com

  • Computers communicate using IP addresses like 93.184.216.34

DNS is the system that connects these two.

So when we enter a website name, DNS tells the browser:

“This name belongs to this IP address.”

Only after that can the browser talk to the correct server.


Why DNS Records Are Needed

DNS is not just one big list. It is a collection of records, and each record solves a specific problem.

Websites today do more than just show pages. They handle emails, subdomains, security checks, and verifications. One single mapping is not enough for all of this.

DNS records exist so that:

  • browsers know where to load the website from

  • email systems know where to deliver emails

  • services can verify domain ownership

  • traffic can be managed cleanly and separately

Each DNS record answers one specific question about a domain.


What an NS Record Is (Who Is Responsible for a Domain)

NS stands for Name Server.

An NS record tells the internet:

“These servers are responsible for answering DNS questions for this domain.”

This is about authority, not IP addresses.

When DNS lookup starts, the system does not immediately ask for an IP address. First, it asks:

“Who should I talk to about this domain?”

NS records provide that answer.

They act like a signboard saying:

“For anything related to this domain, ask these name servers.”

Without NS records, a domain has no official place to store its DNS information**.**


What an A Record Is (Domain → IPv4 Address)

An A record connects a domain name to an IPv4 address.

This is the most basic and important DNS record for a website.

When we open a website in a browser, eventually DNS needs to answer:

“Which IP address should we connect to?”

That answer usually comes from an A record.

For example:

This is how browsers find the actual server machine that hosts the website.


What an AAAA Record Is (Domain → IPv6 Address)

An AAAA record does the same job as an A record, but for IPv6 addresses instead of IPv4.

IPv6 exists because the internet ran out of IPv4 addresses.

So:

  • A record → IPv4

  • AAAA record → IPv6

Modern systems can use either. If both exist, the browser usually prefers IPv6.

Conceptually, both records solve the same problem:

turning a name into a reachable server address.


What a CNAME Record Is (One Name Pointing to Another Name)

CNAME stands for Canonical Name.

A CNAME record does not point to an IP address.

Instead, it points to another domain name.

This is useful when:

  • multiple names should lead to the same place

  • the actual server IP might change later

For example:

Here, www.example.com does not have its own IP. It simply says:

“Go ask example.com for the real address.”

CNAME helps avoid duplication and keeps DNS easier to manage.


What an MX Record Is (How Emails Find the Mail Server)

MX stands for Mail Exchange.

MX records are used only for email, not websites.

When someone sends an email to hello@example.com, the sending mail server asks:

“Where should I deliver emails for this domain?”

The answer comes from MX records.

MX records point to mail servers, not web servers.

This is why:

  • a website can be hosted on one service

  • email can be handled by another service

This separation is intentional and very important.


What a TXT Record Is (Extra Information and Verification)

TXT records store plain text information about a domain.

They are commonly used for:

  • domain ownership verification

  • email security (SPF, DKIM, DMARC)

  • service integrations

TXT records usually do not affect website loading directly.

Instead, they help other systems trust the domain.

Think of TXT records as notes attached to a domain, readable by machines.


How All DNS Records Work Together for One Website

A real website does not rely on just one DNS record.

For a single domain:

  • NS records define who controls DNS

  • A / AAAA records define where the website lives

  • CNAME records manage alternate names

  • MX records handle email delivery

  • TXT records provide verification and security info

Each record has a clear role.

Together, they allow a domain to function fully on the internet.

DNS works well because responsibilities are separated, not mixed.


A Record vs CNAME

An A record points directly to an IP address.

A CNAME points to another domain name.

If we need a final destination → A / AAAA

If we need an alias → CNAME

NS vs MX

NS records decide who answers DNS questions.

MX records decide where emails are delivered.

They solve completely different problems.

At a very high level, this is what happens:

  1. Browser gets a domain name

  2. DNS finds the correct name servers (NS)

  3. Name servers provide the needed records

  4. Browser gets an IP address (A / AAAA)

  5. Browser connects to the server

  6. Website loads

All of this happens in milliseconds.