DNS Record Types Explained
Let me ask you something.
You type github.com in your browser. Two seconds later, you're scrolling through repositories. But here's the thing — computers don't understand "github.com". They only speak numbers. IP addresses.
So how did your browser figure out where to go?
DNS. That's how.
The Internet's Contact List
Think of DNS like your phone's contact list.
You don't memorize your friend's number. You just tap "Rahul" and your phone knows +91-98765-43210. DNS does the same thing for the internet. You type a name, DNS returns the address.
But here's where it gets interesting — DNS isn't just one simple lookup. It's a whole system of different record types, each doing a specific job.
Let's break them down. One at a time.
NS Record — "Who's in Charge Here?"
Before anything else, the internet needs to know: who is responsible for this domain?
That's what NS (Name Server) records do.
When you buy a domain from GoDaddy or Namecheap, you point it to nameservers. Those nameservers hold all the other DNS records for your domain.
tanishbhandari.com NS ns1.cloudflare.com
tanishbhandari.com NS ns2.cloudflare.com
It's like saying: "Hey, if anyone asks about tanishbhandari.com, go talk to Cloudflare. They have all the answers."
What problem does it solve? Delegation. The internet is massive — NS records tell the system exactly where to look for your domain's information.
A Record — "Here's the Address"
Now we're talking.
The A record is the most common DNS record. It maps your domain name to an IPv4 address.
tanishbhandari.com A 192.168.1.100
When someone types your domain, the A record says: "Go to this IP address. That's where the website lives."
Simple. Direct. No confusion.
What problem does it solve? The fundamental translation — human-readable name to machine-readable address.
AAAA Record — "Same Thing, But IPv6"
IPv4 addresses are running out. We've been saying this for years, and it's actually happening.
Enter IPv6 — longer addresses, more combinations, future-proof.
The AAAA record (yes, four As) does the same job as an A record, but for IPv6.
tanishbhandari.com AAAA 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Why four As? IPv6 addresses are four times longer than IPv4. That's it. That's the reason.
What problem does it solve? Future compatibility. As the internet moves to IPv6, your domain needs to be ready.
CNAME Record — "Just Ask That Guy"
Here's where beginners get confused. Stay with me.
A CNAME (Canonical Name) record doesn't point to an IP address. It points to another domain name.
www.tanishbhandari.com CNAME tanishbhandari.com
blog.tanishbhandari.com CNAME tanishbhandari.com
It's like calling a company and the receptionist says: "Let me transfer you to the main office."
The www version doesn't have its own IP. It just redirects to the main domain, which then uses the A record to find the actual IP.
Why use CNAME instead of another A record?
Flexibility. If your IP changes, you update one A record. All the CNAMEs automatically follow. No need to update ten different records.
What problem does it solve? Avoiding repetition and making IP changes painless.
MX Record — "Where Do Emails Go?"
You've got a website. But what about emails?
When someone sends an email to hello@tanishbhandari.com, how does it reach you? The browser doesn't handle this. Your web server doesn't handle this.
MX (Mail Exchange) records tell the internet where to deliver emails for your domain.
tanishbhandari.com MX 10 mail.google.com
tanishbhandari.com MX 20 mail-backup.google.com
See that number? That's priority. Lower number = higher priority.
If the primary mail server is down, emails go to the backup. Smart, right?
What problem does it solve? Email routing. Without MX records, emails to your domain would have nowhere to go.
TXT Record — "Here's Some Extra Info"
TXT records are the sticky notes of DNS.
They hold text information — anything you want. But they're mostly used for:
- Domain verification — Proving you own the domain
- Email security — SPF, DKIM, DMARC records
- Service connections — Google Search Console, analytics tools
tanishbhandari.com TXT "v=spf1 include:_spf.google.com ~all"
tanishbhandari.com TXT "google-site-verification=abc123xyz"
When Google says "Add this TXT record to verify ownership" — this is what they mean.
What problem does it solve? Verification and security. It's proof that you control the domain.
How It All Works Together
Let's see a real-world setup. Say you're launching a portfolio website with custom email.
Your DNS records might look like this:
; Name Servers - Who manages this domain
tanishbhandari.com NS ns1.cloudflare.com
tanishbhandari.com NS ns2.cloudflare.com
; Website - Where the site lives
tanishbhandari.com A 76.76.21.21
www.tanishbhandari.com CNAME tanishbhandari.com
; Email - Where emails go
tanishbhandari.com MX 10 mx1.emailprovider.com
tanishbhandari.com MX 20 mx2.emailprovider.com
; Security & Verification
tanishbhandari.com TXT "v=spf1 include:emailprovider.com ~all"
Here's what happens when someone visits your site:
- Browser asks: "Where's
tanishbhandari.com?" - DNS checks NS records → "Ask Cloudflare"
- Cloudflare checks A record → "Go to
76.76.21.21" - Browser connects to that IP → Website loads
And when someone sends you an email:
- Email server asks: "Where do I deliver mail for this domain?"
- DNS checks MX records → "Send to
mx1.emailprovider.com" - Email gets delivered
Different records. Different jobs. One unified system.
Quick Recap
| Record | What It Does | Example |
|---|---|---|
| NS | Who manages the domain | "Ask Cloudflare" |
| A | Domain → IPv4 address | "Go to 192.168.1.1" |
| AAAA | Domain → IPv6 address | "Go to 2001:db8::1" |
| CNAME | Domain → Another domain | "www points to main" |
| MX | Where emails go | "Use Gmail servers" |
| TXT | Extra info & verification | "I own this domain" |
Common Confusions (Cleared)
"A record vs CNAME — which one do I use?"
Use A record for your main domain. Use CNAME for subdomains that should follow the main domain. You cannot use CNAME on the root domain (like example.com), only on subdomains (like www.example.com).
"NS vs MX — aren't they similar?"
No. NS says who manages your entire DNS. MX says where emails should be delivered. Completely different jobs.
"Do I need all these records?"
Not always. A basic website needs NS + A records minimum. Add MX if you want emails. Add TXT for verification and security. Add CNAME for subdomains.
Wrapping Up
DNS isn't complicated. It's just a system of lookups.
Every record type exists because it solves a specific problem. NS delegates authority. A points to addresses. CNAME creates aliases. MX routes emails. TXT stores metadata.
Once you understand what problem each record solves, you'll never be confused again.
Now go check your domain's DNS records. You'll finally understand what all those entries mean.