# DNS Record Types Explained (Beginner-Friendly Guide)

You type:

```text
google.com
```

And the website loads.

But here’s the real question:

**How does the browser know where the website lives?**

The answer is:

> **DNS + DNS Records**

* * *

## What is DNS?

DNS = **Internet’s phonebook**

*   You search by name → get IP address
    
*   Example:
    

```text
google.com → 142.250.xxx.xxx
```

* * *

## Why Do We Need DNS Records?

DNS alone is not enough.

We need **instructions**

These instructions are called:

> **DNS Records**

* * *

## Imagine

Think of DNS records like:

> Contact details for a domain

Each record answers a different question.

* * *

## Types of DNS Records

We’ll go step-by-step.

* * *

### 1\. NS Record (Who is in charge?)

NS = **Name Server**

Tells:

> “Which server is responsible for this domain?”

* * *

### Example:

```text
google.com → ns1.google.com
```

This means:

*   Google manages its own DNS
    

* * *

### Like:

> “Which office handles this address?”

* * *

### 2\. A Record (IPv4 Address)

A = **Address Record**

Maps:

```text
domain → IPv4 address
```

* * *

### Example:

```text
google.com → 142.250.183.14
```

* * *

### Like:

> House address

* * *

### 3\. AAAA Record (IPv6 Address)

Same as A record, but for **IPv6**

* * *

### Example:

```text
google.com → 2404:6800:4009:...
```

* * *

### Like:

> New-style modern address

* * *

### 4\. CNAME Record (Alias)

CNAME = **Canonical Name**

Maps:

```text
one domain → another domain
```

* * *

### Example:

```text
www.example.com → example.com
```

* * *

### Like:

> Nickname → Real name

* * *

### Important Rule

CNAME does NOT point to IP, It points to another domain

* * *

### 5\. MX Record (Email Routing)

MX = **Mail Exchange**

Tells:

> “Where should emails go?”

* * *

### Example:

```text
example.com → mail.google.com
```

* * *

### Like:

> Post office for emails

* * *

### 6\. TXT Record (Extra Info)

TXT = **Text Record**

Stores:

*   Verification data
    
*   Security policies (SPF, DKIM)
    

* * *

### Example:

```text
"google-site-verification=abc123"
```

* * *

### Like:

> Notes attached to your address

* * *

## How All Records Work Together

Let’s say you open:

```text
www.example.com
```

* * *

### Step-by-step:

1.  NS → Who manages domain
    
2.  CNAME → Points to main domain
    
3.  A → Gives IP address
    
4.  MX → Handles email
    
5.  TXT → Verification/security
    

* * *

### Full Flow

```text
Browser
  ↓
DNS Query
  ↓
NS → A / AAAA → IP
  ↓
Server
```

* * *

### Common Confusions (IMPORTANT)

* * *

### A vs CNAME

| A Record | CNAME |
| --- | --- |
| Points to IP | Points to domain |
| Direct mapping | Alias |

* * *

### NS vs MX

| NS | MX |
| --- | --- |
| DNS control | Email routing |
| Domain-level | Mail-level |

* * *

### Example:

```text
example.com
│
├── NS → ns1.provider.com
├── A → 192.168.1.1
├── CNAME → www → example.com
├── MX → mail.provider.com
└── TXT → verification code
```

* * *

### Why This Matters:

Understanding DNS records helps you:

*   Deploy websites
    
*   Fix domain issues
    
*   Configure email
    
*   Work with cloud (AWS, Vercel, etc.)
    

* * *

### Final Thought

DNS is not just one thing.

*   It’s a **system of records working together**.
