Skip to main content

Command Palette

Search for a command to run...

DNS Record Types Explained

Published
•4 min read•View as Markdown
DNS Record Types Explained

How does a browser know where a website lives?

When you type google.com into your browser, something interesting happens.

Your browser doesn’t actually understand names like google.com.
Computers only understand numbers (IP addresses).

So the real question is:

How does google.com turn into something like 142.250.190.14?

That’s where DNS comes in.

What is DNS? (in the simplest terms)

DNS stands for Domain Name System.

Think of DNS as the phonebook of the internet 📖

  • You know a person’s name

  • Your phonebook knows their phone number

  • DNS does the same thing for websites

Human-friendlyComputer-friendly
google.com142.250.190.14

Without DNS, you would have to remember IP addresses for every website you visit.
That would be painful 😅

Why do DNS records exist?

DNS is not just one mapping.

A website needs to answer multiple questions:

  • Who manages this domain?

  • Where is the website hosted?

  • Where should emails go?

  • Is this domain verified?

Each of these questions is solved using DNS records.

👉 A DNS record is simply an instruction stored in DNS that answers a specific question.

Now let’s look at each record one at a time, slowly and clearly.

What is an NS Record? (Who is responsible for the domain)

https://substackcdn.com/image/fetch/%24s_%21P_Ol%21%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0a1bb2c-a1bc-40ce-abde-6fb9d2a66ce8_1600x570.png

https://simpledns.plus/kb/img/64/3.png

NS stands for Name Server.

An NS record answers this question:

“Who is responsible for this domain?”

Think of it like this:

  • The internet asks: Who should I talk to about example.com?

  • The NS record replies: Ask these servers.

Real-life example

Imagine an apartment building:

  • The city doesn’t know each flat owner

  • It only knows who manages the building

NS records are like the building manager.

Without NS records:

  • No one knows where the DNS information for your domain lives

What is an A Record? (Domain → IPv4 address)

https://library.mosse-institute.com/_images/dns.png

https://andreyka26.com/assets/2023-08-21-how-to-create-domain-and-point-it-to-your-id-address/logo-wide.png

A stands for Address.

An A record answers:

“What is the IPv4 address of this domain?”

Example:

example.com → 93.184.216.34

Real-life example

  • Domain name = person’s name

  • IP address = house number

When a browser wants to load your website, this is the most important record it looks for.


What is an AAAA Record? (Domain → IPv6 address)

AAAA is the IPv6 version of an A record.

  • A Record → IPv4 (older format)

  • AAAA Record → IPv6 (newer format)

Example:

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

You don’t need to stress about IPv6 yet.
Just remember:

Same purpose as A record, newer address format


What is a CNAME Record? (One name pointing to another name)

https://www.keycdn.com/img/support/cname.png

https://global.discourse-cdn.com/cloudflare/original/3X/c/8/c816c14fff54a292efe27629cecbdcf6237160e4.png

CNAME stands for Canonical Name.

It answers:

“This domain is just an alias — go look at that other name.”

Example:

www.example.com → example.com

Real-life example

  • “Call me on my office number”

  • Office number redirects to your main phone

Important beginner clarification: A vs CNAME

  • A record points to an IP address

  • CNAME points to another domain name

👉 You cannot use both on the same hostname.


What is an MX Record? (How emails find your mail server)

https://images.ctfassets.net/aoyx73g9h2pg/3VzrRaM5aobH71Zzy9QUDA/c75752c807f193c7ddabd1ffa5f39d27/MX-record-DNS-Diagram.jpg

https://kodekloud.com/kk-media/image/upload/v1752873251/notes-assets/images/Demystifying-DNS-MX-Records/mx-records-email-routing-diagram.jpg

MX stands for Mail Exchange.

It answers:

“Where should emails for this domain be delivered?”

Example:

example.com → mail.google.com

Real-life example

  • Your domain = company name

  • MX record = post office address

Emails don’t go to your website server.
They go to your mail server — and MX records make sure of that.

Common confusion: NS vs MX

  • NS → who manages DNS

  • MX → who receives emails

Different jobs. Different records.


What is a TXT Record? (Extra information & verification)

TXT records store plain text information.

They are commonly used for:

  • Domain ownership verification

  • Email security (SPF, DKIM, DMARC)

  • Third-party service verification

Example:

"google-site-verification=abc123"

Real-life example

TXT records are like sticky notes on your domain:

“Yes, I own this.”
“Allow this service.”


How all DNS records work together for one website

https://s3.us-east-2.wasabisys.com/gridpanekb/dns-records/GridPane-DNS-Records-minus-canary.jpg

https://assets.gcore.pro/site-media/uploads-staging/dns_records_explained_1_686969a9dc.png

Let’s say you own myblog.com.

Here’s what happens behind the scenes:

  1. NS record
    → Tells the internet where DNS info lives

  2. A / AAAA record
    → Tells browsers where your website server is

  3. CNAME record
    → Redirects www.myblog.com to myblog.com

  4. MX record
    → Sends emails to the correct mail server

  5. TXT record
    → Verifies services and protects email

Each record solves one specific problem.
Together, they make your domain fully functional.


One simple way to remember DNS records

RecordPurpose
NSWho manages the domain
AWebsite IPv4 address
AAAAWebsite IPv6 address
CNAMEAlias to another name
MXEmail delivery
TXTVerification & extra info

Final takeaway

DNS is not scary.
It’s just a well-organized system of instructions.

If you remember one thing, remember this:

DNS is the phonebook.
DNS records are the entries.
Each record answers one clear question.

Once this clicks, DNS stops feeling magical — and starts feeling logical.