# DNS for Dummies

> **Your browser is kind of dumb.**  
> It doesn’t understand website names like [google.com](http://google.com) or [youtube.com](http://youtube.com) , it only understands numbers called IP addresses. So when you type a website name, the browser has no idea where that site actually lives. It’s like asking someone to call a friend by name when phones only work with phone numbers.
> 
> In the early days of the internet, people could remember which IP address belonged to which computer. This was a terrible long-term plan. As more devices and humans joined the network, memorizing long strings of numbers became unrealistic. While you *can* still type an IP address into a browser, no one wants to live like that. Humans like names. Computers like numbers. **DNS exists to keep the peace**, acting as the phonebook of the internet and translating website names into the numeric addresses computers insist on using.

![The Ins and Outs of DNS: A Technical Guide](https://substackcdn.com/image/fetch/$s_!Ncu_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0c27564-9f09-41bd-a38d-786c76f41b03_2094x1076.png align="left")

## **So what is DNS?**

DNS is a lookup system. You type a website name, DNS finds its IP address, and your browser connects to it. Without DNS, websites wouldn’t load, emails wouldn’t work, and the internet wouldn’t function.

## DNS as a Real-Life System

| Internet | Real Life |
| --- | --- |
| Domain name | Person’s name |
| IP address | Phone number |
| DNS server | Contacts app |
| DNS record | Contact entry |

## What are DNS Records?

Asking DNS is like asking for a friend’s address:

* Sometimes you get the exact house address
    
* Sometimes you’re told who has the address
    
* Sometimes you’re redirected because your friend moved
    

DNS records are simply the rules that decide **which kind of answer you get**.

When you ask DNS something like *“What’s the IP address of* [*google.com*](http://google.com)*?”*, one of two things happens:

* The DNS server knows the answer and gives you the IP address
    
* Or it doesn’t know, but knows who to ask next
    

That’s why DNS records exist.

Different DNS records answer different questions:

* Some give final answers
    
* Some point to the right authority
    
* Some handle email or aliases
    
* Some exist for security and verification
    

# Types of Records

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769528584174/94a6a91a-9b81-4906-81c1-605dd7a26f1e.png align="center")

## A Record - Where the Website Lives

**Problem it solves:**  
Your browser needs a numeric address to reach a website.

**What it does:**  
An A record connects a domain name to an IPv4 address. When you type a website name, this is usually the record that finally gives your browser the exact location of the server.

**Real-life example:**  
A house name mapped to its street address so delivery drivers know where to go.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769528727187/f2ad0052-c5f8-4aa4-b76a-1f228a58f117.png align="center")

## AAAA Record - The New Address Format

**Problem it solves:**  
The internet is running out of old-style addresses.

**What it does:**  
AAAA records do the same job as A records but use IPv6, which supports far more devices and servers. Modern systems prefer AAAA when available.

**Real-life example:**

The same house address written in a newer, more detailed GPS format.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769528644024/1a3b4de0-33c7-4f4e-9bb4-a9063ba71473.png align="center")

## CNAME Record - Multiple Names, One Place

**Problem it solves:**  
Websites often need more than one name pointing to the same location.

**What it does:**  
A CNAME record makes one domain name act as an alias for another. Instead of pointing directly to an IP, it points to a different domain name that already knows where to go.

**Real-life example:**  
“Mom” and “Mother” both calling the same phone number.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769528786498/2adc4037-405b-45e5-b34c-706f46385112.png align="center")

## MX Record - Where Emails Should Go

**Problem it solves:**  
Email systems need to know which server receives mail for a domain.

**What it does:**  
MX records tell email servers where to deliver messages sent to addresses like [`user@example.com`](mailto:user@example.com). They often include backup servers in case the main one is unavailable.

**Real-life example:**  
A company’s mailroom address, not the front door.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769528757491/b566c6fd-8746-4104-8c2c-bf92fa81b57a.png align="center")

## NS Record - Who’s in Charge of the Domain

**Problem it solves:**  
The internet needs to know which DNS servers are the final authority for a domain.

**What it does:**  
NS records point to the authoritative DNS servers that store all the records for a domain. Any serious DNS question eventually ends up here.

**Real-life example:**  
Knowing which post office handles all mail for your neighborhood.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769528689128/d3467866-fe6d-4c06-9ab8-a8c90708afca.png align="center")

## TXT Record - Proof, Rules, and Notes

**Problem it solves:**  
Domains need a way to prove ownership and set rules.

**What it does:**  
TXT records store text data used for verification, security, and trust, especially for email protection and third-party services.For example, proving to Google or your email provider that you own the domain.

**Real-life example:**  
A note taped to your door saying, “Yes, this really is my house.”

## Common DNS Confusions

### A Record vs CNAME Record

**Why this is confusing:**  
Both seem to “point” something to somewhere.

**The simple difference:**

* **A record** → name points **directly to an IP address**
    
* **CNAME** → name points **to another name**
    

**Easy way to remember:**

* A record = final destination
    
* CNAME = forwarding address
    

**Real-life example:**

* A record: “This house lives at 42 Main Street”
    
* CNAME: “This nickname actually means that house”
    

### NS Record vs MX Record

**Why this is confusing:**  
Both mention servers.

**The simple difference:**

* **NS record** → who controls the domain’s DNS
    
* **MX record** → who receives email for the domain
    

**They solve completely different problems.**

**Real-life example:**

* NS: Which post office handles your neighborhood
    
* MX: Which mailbox receives your letters
    

### A / AAAA Records vs MX Records

**Common mistake:**  
Thinking the web server also handles email.

**Reality:**

* **A / AAAA** → website traffic
    
* **MX** → email traffic
    

They often point to **different servers**.

### TXT Records vs “Everything Else”

**Why TXT feels mysterious:**  
It doesn’t point anywhere.

**What it actually does:**  
TXT records provide **proof, rules, and trust signals**, especially for email and third-party services.

**Think of TXT as:**  
Written instructions, not directions.

### “Why Are There So Many Records?”

Because one record doing everything would:

* Be messy
    
* Be insecure
    
* Break easily
    

DNS is split into small, focused pieces so each problem is solved cleanly.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769529186452/c1e0cdc8-10a5-4d2f-8df6-12fcc268df12.png align="center")

# How All DNS Records Work Together for One Website

Let’s say you visit **example.com**.

### Step 1: Who’s in charge? (NS Record)

First, DNS needs to know **who manages this domain**.  
The **NS record** answers that by pointing to the authoritative DNS servers for example.com.

*Real-life example:*  
Finding out which post office handles mail for a neighborhood.

### Step 2: What’s the real address? (A / AAAA Records)

Once the correct DNS server is found, it’s asked:

> “Where does this website live?”

The **A record** gives the IPv4 address.  
The **AAAA record** gives the IPv6 address (if available).

Your browser now knows the exact server to contact.

*Real-life example:*  
Getting the street address of a house.

### Step 3: Are there multiple names? (CNAME Record)

If you visit [**www.example.com**](http://www.example.com), DNS may not give an IP immediately.  
Instead, a **CNAME record** might say:

> “That’s just another name for example.com.”

DNS then follows the real name and finds the A or AAAA record.

*Real-life example:*  
Calling a friend using their nickname saved in your contacts.

### Step 4: What about email? (MX Record)

Separately, when someone emails **user@example.com**, DNS is asked:

> “Where should this email go?”

The **MX record** points to the correct mail server, which may be completely different from the web server.

*Real-life example:*  
Mail going to a building’s mailroom, not the front door.

### Step 5: Is this domain trusted? (TXT Record)

Before emails are accepted or services are connected, DNS checks **TXT records** to verify:

* Ownership
    
* Email legitimacy
    
* Security rules
    

*Real-life example:*  
Showing ID before being allowed inside.

## One Domain, Many Jobs

For a single website, DNS handles:

* **NS** → Who manages the domain
    
* **A / AAAA** → Where the website lives
    
* **CNAME** → Alternate names
    
* **MX** → Email delivery
    
* **TXT** → Trust and verification
    

Each record does **one simple job**, but together they make websites load, emails arrive, and security work all in the background, without you noticing.

# Conclusion

DNS is one of those systems you never notice when it works and immediately notice when it doesn’t. Understanding it gives you a clearer picture of how the internet actually holds itself together.
