Skip to main content

Command Palette

Search for a command to run...

DNS Record Types Explained

Published
3 min readView as Markdown
DNS Record Types Explained

Introduction: What Is DNS?

When you open a website like:

google.com

your computer cannot understand this name.

Computers only understand IP addresses, like:

142.250.190.14

DNS helps your computer find the correct IP address for a website name.

DNS is like a contact list of the internet.
You search by name, DNS gives the number.


Why DNS Records Are Needed

A website is not just one thing.

It needs:

  • An IP address to load the site

  • A mail server to receive emails

  • Ownership information

  • Security verification

DNS records store different types of information about a domain.

Each record has one clear responsibility.


What Is an NS Record? (Who Is Responsible)

NS = Name Server

An NS record answers this question:

“Who is responsible for managing DNS for this domain?”

Example:

google.com → ns1.google.com

This means:

  • These name servers have the final authority

  • They decide what IP, mail server, etc., the domain uses

https://images.ctfassets.net/aoyx73g9h2pg/K7ta7xXcX0AAIXGbunczP/0afc11054a40d03b9e0d4507c62f0cb9/DNS-NS-Record-Diagram.jpg

https://images.openai.com/static-rsc-3/v7iHjuBYNqVRIO8sGA2khay3jxWvJ-wQK_-u_3UTtvcztya5Ve846LVrhaOfj4drOYlXNwySKiKw87vsxVi99mTSoj1OXp8hdBEHhqgasME?purpose=fullsize

Important:
NS records do NOT store IP addresses.
They only point to who manages the domain.


What Is an A Record? (Domain → IPv4 Address)

A = Address

An A record maps:

domain name → IPv4 address

Example:

google.com → 142.250.190.14

This is the most important record for websites.

When you type a website in the browser:

  • DNS looks for the A record

  • Browser connects to that IP

https://cf-assets.www.cloudflare.com/slt3lc6tev37/6Cxvsc4NOvmU4pPkKbkDmP/a7588a4c8a3c187e9175a40fa1b3d548/dns_record_request_sequence_authoritative_nameserver.png

https://assets.bytebytego.com/diagrams/0176-dns-look-up.png


What Is an AAAA Record? (Domain → IPv6 Address)

AAAA record is similar to A record, but:

  • A → IPv4

  • AAAA → IPv6

Example:

google.com → 2607:f8b0:4005:805::200e

Why IPv6?

  • IPv4 addresses are limited

  • IPv6 provides many more addresses

https://images.ctfassets.net/aoyx73g9h2pg/qJoE9tXXXxCUYiB3bfXqq/c08ab6877b63f412d8c2957b28dccc8f/What-is-an-AAAA-record-Diagram.jpg

https://media.licdn.com/dms/image/v2/D5612AQEFgI8SshpAkA/article-cover_image-shrink_720_1280/article-cover_image-shrink_720_1280/0/1687357981319?e=2147483647&t=i2jfUYrLZUilAU_DjAS3x6MdgUnr8l5p15mu_j4pZm0&v=beta

Modern systems prefer IPv6 if available.


What Is a CNAME Record? (Name Pointing to Name)

CNAME = Canonical Name

A CNAME record points:

one domain name → another domain name

Example:

www.example.com → example.com

This means:

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

https://www.mailersend.com/img/containers/gcs/blog/blog-dns-cname-graph2-min.png/949e2350d7206bb5e12cf1d4db6eaa11.webp

Why CNAME is useful:

  • Easy management

  • One place to change IP

  • Subdomains stay updated automatically


What Is an MX Record? (Email Routing)

MX = Mail Exchange

MX records tell the internet:

“Where should emails for this domain be delivered?”

Example:

example.com → mail.google.com

When someone sends:

hello@example.com

DNS uses MX records to find the mail server.

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

https://www.techfry.com/images/webmaster/mx-record-working.jpg

Without MX records:

  • Emails will not reach your domain

What Is a TXT Record? (Extra Information & Verification)

TXT = Text

TXT records store extra information.

Common uses:

  • Domain ownership verification

  • Email security (SPF, DKIM, DMARC)

  • Third-party service verification

Example:

google-site-verification=xyz123

https://www.codetwo.com/media/images/1018-1-spf-verification-diagram.jpg

https://www.mailhardener.com/images/gcloud_dns_2.PNG

TXT records do not affect website loading directly,
but they are very important for security and trust.


How All DNS Records Work Together (One Website)

Let’s take one example:

example.com

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

https://miro.medium.com/0%2Aw4_IIjmSUdtMp-hT

Step-by-Step Flow

  1. NS Record

    • Finds who manages the domain
  2. A / AAAA Record

    • Finds the server IP
  3. CNAME

    • Handles subdomains like www
  4. MX Record

    • Routes emails
  5. TXT Record

    • Verifies ownership and security

Each record has one job, and together they make the website work.

More from this blog

blog

14 posts

This contains Basics of Git, Networks and HTML