Back to blog
Computer Networks

DNS Record Types Explained

Feb 15, 2026 7 min read

How Does Your Browser Know Where a Website Lives?

When you type google.com into your browser and press Enter, something happens in milliseconds. Your browser somehow finds Google's servers among billions of devices connected to the internet.

But how?

The answer is DNS — the Domain Name System. Think of it as the internet's phonebook.


What is DNS?

Imagine you want to call your friend. You don't memorize their phone number — you just look up their name in your contacts, and your phone finds the number for you.

DNS works exactly the same way.

Every device on the internet has a unique address called an IP address (like 142.250.80.46). But remembering numbers like that for every website would be impossible. So instead, we use easy-to-remember names like google.com, and DNS translates those names into IP addresses.

That's it. DNS is just a translation service — turning names into numbers.


Why Do We Need DNS Records?

A single domain name needs to do many things. It needs to show a website, receive emails, prove ownership, and more. Each of these tasks requires different information.

DNS records are like entries on a contact card. Just as your contact card has fields for phone number, email, and home address, a domain has different DNS records for different purposes.

Let's look at each type, one at a time.


NS Record: Who Is In Charge?

NS stands for Name Server. This record answers the question: "Who is responsible for this domain?"

Think of it like buying a house. The city records show which office handles your property records. Similarly, NS records tell the internet which servers are the official source of information for a domain.

Example:

The domain example.com might have an NS record pointing to ns1.cloudflare.com. This tells the internet: "For any questions about example.com, ask Cloudflare's name servers."


A Record: The Main Address

The A record is the most important and common DNS record. It connects your domain name to an IPv4 address — the standard internet address format that looks like four numbers separated by dots.

Think of the A record as your home's street address. When someone wants to visit you, they need your address. When a browser wants to visit your website, it needs the A record.

Example:

mywebsite.com → 93.184.216.34

When someone visits mywebsite.com, DNS returns the IP address, and the browser connects to that server.


AAAA Record: The Newer Address Format

The AAAA record (pronounced "quad-A") does the same job as the A record, but for IPv6 addresses — a newer address format.

Why do we need it? The internet ran out of IPv4 addresses. There are only about 4 billion possible IPv4 addresses, but we have way more devices than that now. IPv6 solves this by using a longer format.

IPv6 addresses look different. Instead of four short numbers, they're longer and include letters:

  • IPv4: 192.168.1.1
  • IPv6: 2607:f8b0:4004:800::200e

Most websites have both A and AAAA records, so they work with both old and new devices.


CNAME Record: A Nickname for Another Name

CNAME stands for Canonical Name. It creates an alias — one domain name that points to another domain name.

Imagine you have a friend named "Robert" but everyone calls him "Bob." If you ask for Bob, people know you mean Robert. A CNAME works the same way — it's a nickname that redirects to the real name.

Common use: Making www.yoursite.com and yoursite.com both work. The www version is often a CNAME pointing to the main domain.

Example:

www.mysite.com → CNAME → mysite.com → A record → 93.184.216.34

A vs CNAME: What's the Difference?

This confuses many beginners. Here's the simple distinction:

A record: Points a domain name directly to an IP address (a number).

CNAME: Points a domain name to another domain name (which eventually leads to an IP).

Use A records when you know the exact IP address. Use CNAME when you want your domain to follow wherever another domain points — useful when using services like Shopify, Netlify, or Heroku that might change their IP addresses.


MX Record: How Emails Find You

MX stands for Mail Exchange. These records tell the internet where to deliver emails for your domain.

Think of MX records like a post office. When someone sends a letter to "123 Main Street," the postal service knows which post office handles that address. MX records tell email servers which mail server handles emails for @yourdomain.com.

Example:

When someone emails [email protected], the sender's email server asks DNS: "Where do I send mail for mybusiness.com?" The MX record responds: "Send it to mail.google.com."

MX records also have a priority number. Lower numbers are tried first. If that server is down, email goes to the backup server with the next lowest priority.

NS vs MX: Don't Confuse Them

NS records: Tell the internet who manages all information about your domain.

MX records: Tell the internet where to send emails specifically.

NS is about domain management. MX is about email delivery.


TXT Record: Extra Notes and Verification

TXT records store text information about your domain. They're like sticky notes you can attach to your domain for various purposes.

Common uses:

Verification — Proving you own the domain. When you add your website to Google Search Console, Google asks you to add a TXT record like google-site-verification=abc123xyz789.... This proves to Google that you control the domain, because only the domain owner can add DNS records.

Email security — Adding rules that help prevent spam (SPF, DKIM, DMARC). These TXT records tell email servers which servers are allowed to send mail on your behalf.

Custom information — Any text data a service might need.


How All DNS Records Work Together

Let's see how a real website uses all these records together. Imagine you own mybusiness.com:

What each record does:

NS → Cloudflare manages all DNS for this domain.

A → The main website lives at 93.184.216.34.

AAAA → The website is also reachable via IPv6.

CNAME → www.mybusiness.com redirects to mybusiness.com.

MX → Emails go to Google Workspace (Gmail for business).

TXT → Email security settings to prevent spam and spoofing.

What Happens When Someone Visits www.mybusiness.com

  1. Browser asks DNS for www.mybusiness.com
  2. DNS finds the CNAME → points to mybusiness.com
  3. DNS finds the A record → returns 93.184.216.34
  4. Browser connects to that IP address
  5. Website loads

What Happens When Someone Emails [email protected]

  1. Sender's email server asks DNS for MX record of mybusiness.com
  2. DNS returns mail.google.com
  3. Email is delivered to Google's servers
  4. You see it in your inbox


Quick Reference

NS (Name Server) — Who manages this domain? Points to the authoritative DNS servers. Analogy: Which office has the property records.

A (Address) — What's the IPv4 address? Maps domain to a numeric IP. Analogy: Your home street address.

AAAA (Address v6) — What's the IPv6 address? Same as A, but for the newer address format. Analogy: Your address in a new postal code system.

CNAME (Canonical Name) — Is this a nickname? Points one domain to another. Analogy: "Bob" is short for "Robert."

MX (Mail Exchange) — Where do emails go? Points to the mail server. Analogy: Which post office handles your mail.

TXT (Text) — Any extra notes? Stores verification codes, email security rules, and other text. Analogy: Sticky notes attached to your file


Wrapping Up

DNS might seem complex at first, but it's really just a system of lookups and directions. Every record solves a specific problem:

  • Need to show a website? A record
  • Need to receive email? MX record
  • Need a nickname for your domain? CNAME record
  • Need to prove ownership? TXT record

Start by understanding A records — they're the most common. Then add knowledge of other records as you need them. Most website setups only require a handful of records to work perfectly.

The next time you set up a domain or debug why a website isn't loading, you'll know exactly where to look.

Resources

0 Comments

Sign in to join the conversation

No comments yet. Be the first to comment!