Skip to main content

Command Palette

Search for a command to run...

DNS Record Types Explained

Published
5 min read

Imagine you want to visit a friend’s house for the first time. You don’t just drive around aimlessly; you look up their address. On the internet, websites have addresses too, but they aren’t "https://www.google.com/search?q=google.com"—that’s just the name we humans use. Behind the scenes, the internet runs on numbers.

What is DNS? (The Internet’s Phonebook)

DNS (Domain Name System) is essentially the phonebook of the internet.

In your phone, you save a contact as "Mom" so you don’t have to memorize 555-0199. DNS does the same thing: it translates a human-friendly name like example.com into a machine-friendly IP address like 192.0.2.1. Without DNS, you’d have to memorize a string of numbers for every single website you visit!

Why do we need "Records"?

If DNS is the phonebook, DNS Records are the individual entries in that book. But it’s not just a list of phone numbers. Think of it like a business listing that includes:

  • The physical street address (where the website lives)

  • The mailing address (where emails go)

  • Verification notes (to prove you own the business)

Each "record type" serves a specific purpose to make sure your corner of the internet works correctly.

1. NS Record: The Manager

The Problem: How does the internet know who is officially in charge of your domain?

The Solution: The NS (Name Server) Record.

The NS record tells the world which server holds the "master file" for your domain. If you bought your domain at Company A but host your website at Company B, the NS record points to Company B so they can manage the rest of your settings.

  • Real-life example: It’s like a directory at the mall telling you, "For information about this store, talk to the manager in Office 202."

2. A Record: The Street Address

The Problem: Your browser knows the name website.com, but it needs to know which server (computer) to talk to.

The Solution: The A Record (Address Record).

This is the most common record. it maps a domain name to an IPv4 address (four sets of numbers like 192.168.1.1).

  • Real-life example: Your house address. "The Smith House" = "123 Maple Street."

3. AAAA Record: The New Street Address

The Problem: We are running out of old IPv4 addresses because there are too many devices on earth.

The Solution: The AAAA Record (pronounced "Quad-A").

It works exactly like an A record, but it points to an IPv6 address, which is much longer and looks like a mix of letters and numbers (e.g., 2001:db8:85a3::8a2e:370:7334). It’s just a bigger, modern version of the A record.

4. CNAME Record: The Alias

The Problem: You want multiple names to lead to the same place, but you don’t want to update ten different IP addresses every time your server changes.

The Solution: The CNAME (Canonical Name).

A CNAME points one name to another name instead of an IP address.

  • Real-life example: You have a contact named "Work," but you set it to just dial whatever number is saved under "Main Office." If the office changes its number, you only update it once.

  • Common Use: Pointing www.yoursite.com to the "root" yoursite.com.

5. MX Record: The Post Office

The Problem: When someone emails hello@yourdomain.com, how does the internet know which email provider (like Gmail or Outlook) should catch it?

The Solution: The MX (Mail Exchanger) Record.

MX records specifically handle email. They tell the internet where to deliver your mail. You can even have multiple MX records with different "priorities" in case one mail server goes down.

  • Real-life example: A P.O. Box. Even if you move houses (change your A record), your mail still goes to the same post office.

6. TXT Record: The Sticky Note

The Problem: You need to prove to a service (like Google or an email tool) that you actually own the domain, or you want to add security notes.

The Solution: The TXT (Text) Record.

A TXT record is a "blank" record where you can write any text-based information. It’s often used for verification or for security settings that prevent people from spoofing your email.

  • Real-life example: A "Verified" badge on a social media profile. It doesn't tell people where you live; it just proves you are who you say you are.

Clearing Common Confusion

  • A vs. CNAME: An A Record is a final destination (an IP address). A CNAME is just a shortcut to another name. You can't use a CNAME for your main domain (yoursite.com), only for "subdomains" like blog.yoursite.com.

  • NS vs. MX: NS records manage the whole domain's "phonebook," while MX records only care about where the "letters" (emails) go.


How it All Works Together

If you run a small business called FreshBakery.com, your DNS setup might look like this:

Record TypeHost / NamePoints ToPurpose
NS@ns1.hosting.comTells the world who manages your records.
A@93.184.216.34Sends visitors to your website's server.
CNAMEwwwfreshbakery.comMakes sure www also goes to your site.
MX@mail.google.comDelivers your business emails to Gmail.
TXT@v=spf1 include...A security note to prevent email spam.

DNS might seem like magic, but it’s really just a series of simple instructions that keep the internet organized. By setting these records correctly, you ensure that when someone types your name, they find your "home" every single time.