Skip to main content

Command Palette

Search for a command to run...

DNS Record Types Explained

Updated
5 min readView as Markdown

How Your Browser Finds a Website

Have you ever wondered what happens when you type a website name like google.com into your browser? How does the browser know where Google lives?

The answer lies in the fact that browsers don’t understand names—they only understand numbers called IP addresses. Before a website can load, the browser has to answer a simple but critical question:

“Where is this website located?”

This is where DNS, or Domain Name System, comes into play.


What is DNS?

DNS is essentially the phonebook of the Internet. It translates human-friendly names like google.com into numeric IP addresses like 142.250.190.78 that computers use to connect.

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

https://miro.medium.com/1%2AgoSb1oow5UBNF3KkzvOX8A.png

Without DNS, the Internet wouldn’t exist, but using it would be extremely cumbersome. You would need to memorize the IP addresses of every website you wanted to visit. Imagine typing 142.250.190.78 every time you wanted to open Google—definitely not user-friendly!


Why Do We Need DNS Records?

A single domain doesn’t just host a website—it can do many things:

  • Serve a website

  • Receives email

  • Verify domain ownership

  • Point to multiple subdomains

  • Provide control to third-party services

Trying to handle all of this with a single setting would be chaotic. That’s why DNS uses records, with each record answering a specific question.

Let’s break down the main DNS record types and their roles:


NS Record – Who Is Responsible for the Domain?

The NS (Name Server) record answers:

“Who is allowed to answer DNS questions for this domain?”

Think of it as the gatekeeper. NS records don’t point to your website or email—they point to DNS servers that know how to handle requests for your domain.

Before the internet trusts any answer about a domain, it checks:

“Which DNS servers are responsible for this domain?”

⚠️ If NS records are misconfigured, nothing else will work properly—your website might not load, and email could fail to deliver.

NS records do not point to websites or mail servers, and they point only to DNS servers.

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://www.nslookup.io/img/learning/zone-delegation/example-zone-delegation-in-action.png


A Record – Domain Name to IPv4 Address

The A record solves the most fundamental problem:

“What is the IP address of this domain?”

Example:

example.com → 93.184.216.34

Once the browser gets this number, it knows exactly where to go.

A records use IPv4 addresses, the traditional format with four numbers separated by dots.

https://www.cloudns.net/blog/wp-content/uploads/2024/05/cloudns-dns-server-types.png

https://performanceconnectivity.com/wp-content/uploads/DNS-Explained.jpg


AAAA Record – Domain Name to IPv6 Address

The AAAA record does the same job as an A record, but for IPv6:

Example:

example.com → 2001:db8::1

IPv6 exists because IPv4 addresses are running out—there are simply more devices than IPv4 addresses can handle. IPv6 provides an enormous address space, making it future-proof. Most modern websites have both A and AAAA records, and your browser automatically chooses the right one.

https://d2908q01vomqb2.cloudfront.net/5b384ce32d8cdef02bc3a139d4cac0a22bb029e8/2024/03/18/Figure5.jpg

https://media2.dev.to/dynamic/image/width%3D800%2Cheight%3D%2Cfit%3Dscale-down%2Cgravity%3Dauto%2Cformat%3Dauto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgwots6u5c42d2qrf29a9.png


CNAME Record – One Name Pointing to Another Name

Sometimes a domain needs an alias. That’s where CNAME (Canonical Name) records come in:

“This name is just another name for that one.”

Example:

blog.example.com -> www.example.com

The browser then looks up www.example.com to get its IP address.

Key rules about CNAMEs:

  • They never point directly to an IP address.

  • They always point to another domain name.

https://www.tecracer.com/blog/img/2022/02/r53_cname_alias.png

https://unit42.paloaltonetworks.com/wp-content/uploads/2022/10/word-image-29.png

CNAMEs are commonly used for subdomains or when a service provider hosts your domain elsewhere.


MX Record – Directing Email Traffic

Web traffic and email traffic are handled separately. The MX (Mail Exchange) record answers:

“Where should emails for this domain be delivered?”

When someone sends an email to:

user@example.com

The sending server queries DNS for the MX record and routes the email to the correct mail server. MX records can also include priority values, allowing backup mail servers to handle email if the primary server is down.

https://www.practical365.com/wp-content/uploads/2012/11/scenarios.png

https://images.ctfassets.net/t6n243uipzy1/5fECTopj2AnwvPpnawq16x/3bfe35b77ea6abc77d904b114d7942a3/mx_record_info.png


TXT Record – Extra Information and Verification

The TXT record stores plain text information for machines to read.

It is commonly used for:

  • Email security rules (SPF, DKIM, DMARC)

  • Domain ownership verification

  • General instructions for services that need proof of domain control

TXT records are the flexible “notes” of DNS—they exist so that the Internet has a safe place to store information that doesn’t fit into other records.

https://dnsmadeeasy.com/wp-content/uploads/2025/03/62322404793a4a1caab89536_bEO2oXcy7OFUG8p1vudUCT_AZ7KGneHdh1ZTJefZ8JX-w6825EJLEBFOTLZjZZnT5EW1XtSO2khDyQbln7rztdV1PnrqEkosCniU3ThyLQXJ0XZ7VqUsyNSBI2seLvyZfBOPGIss.png

https://anyware.hp.com/web-help/pcoip_management_console/23.06/img/dns_discovery.png


How DNS Records Work Together

A single domain usually has multiple DNS records simultaneously. Here’s how they collaborate:

  • NS records decide who controls DNS

  • A / AAAA records point to the website server

  • CNAME records handle alternate names

  • MX records route email

  • TXT records handle security and verification

Each record solves a different problem, but together they form a complete map for the domain.

https://miro.medium.com/1%2A-kCFoSB3-pMwajK6LTJY6Q.jpeg

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


Common Confusions Explained

  • A vs CNAME:

    • A → points directly to an IP

    • CNAME → points to another domain

Use CNAME when you want one domain to redirect to another domain’s DNS.

  • NS vs MX:

    • NS → who controls DNS

    • MX → where email is delivered

They operate at different layers—never confuse the two.

Final Thoughts

DNS is a quiet cornerstone of the Internet. It turns human-friendly names into the addresses that make websites, email, and domain verification work. Every time you visit a site, DNS is working behind the scenes to get you there.