# DNS Record Types Explained

## Introduction: What Is DNS?

When you open a website like:

```plaintext
google.com
```

your computer cannot understand this name.

Computers only understand **IP addresses**, like:

```plaintext
142.250.190.14
```

DNS helps your computer **find the correct IP address** for a website name.

> **DNS is like a contact list of the internet.**  
> You search by name, DNS gives the number.

---

## Why DNS Records Are Needed

A website is not just one thing.

It needs:

* An IP address to load the site
    
* A mail server to receive emails
    
* Ownership information
    
* Security verification
    

DNS records store **different types of information** about a domain.

Each record has **one clear responsibility**.

---

## What Is an NS Record? (Who Is Responsible)

**NS = Name Server**

An NS record answers this question:

> “Who is responsible for managing DNS for this domain?”

Example:

```plaintext
google.com → ns1.google.com
```

This means:

* These name servers have the final authority
    
* They decide what IP, mail server, etc., the domain uses
    

![https://images.ctfassets.net/aoyx73g9h2pg/K7ta7xXcX0AAIXGbunczP/0afc11054a40d03b9e0d4507c62f0cb9/DNS-NS-Record-Diagram.jpg](https://images.ctfassets.net/aoyx73g9h2pg/K7ta7xXcX0AAIXGbunczP/0afc11054a40d03b9e0d4507c62f0cb9/DNS-NS-Record-Diagram.jpg align="left")

![https://images.openai.com/static-rsc-3/v7iHjuBYNqVRIO8sGA2khay3jxWvJ-wQK_-u_3UTtvcztya5Ve846LVrhaOfj4drOYlXNwySKiKw87vsxVi99mTSoj1OXp8hdBEHhqgasME?purpose=fullsize](https://images.openai.com/static-rsc-3/v7iHjuBYNqVRIO8sGA2khay3jxWvJ-wQK_-u_3UTtvcztya5Ve846LVrhaOfj4drOYlXNwySKiKw87vsxVi99mTSoj1OXp8hdBEHhqgasME?purpose=fullsize align="left")

**Important:**  
NS records do NOT store IP addresses.  
They only point to **who manages the domain**.

---

## What Is an A Record? (Domain → IPv4 Address)

**A = Address**

An A record maps:

```plaintext
domain name → IPv4 address
```

Example:

```plaintext
google.com → 142.250.190.14
```

This is the **most important record for websites**.

When you type a website in the browser:

* DNS looks for the A record
    
* Browser connects to that IP
    

![https://cf-assets.www.cloudflare.com/slt3lc6tev37/6Cxvsc4NOvmU4pPkKbkDmP/a7588a4c8a3c187e9175a40fa1b3d548/dns_record_request_sequence_authoritative_nameserver.png](https://cf-assets.www.cloudflare.com/slt3lc6tev37/6Cxvsc4NOvmU4pPkKbkDmP/a7588a4c8a3c187e9175a40fa1b3d548/dns_record_request_sequence_authoritative_nameserver.png align="left")

![https://assets.bytebytego.com/diagrams/0176-dns-look-up.png](https://assets.bytebytego.com/diagrams/0176-dns-look-up.png align="left")

---

## What Is an AAAA Record? (Domain → IPv6 Address)

AAAA record is similar to A record, but:

* **A** → IPv4
    
* **AAAA** → IPv6
    

Example:

```plaintext
google.com → 2607:f8b0:4005:805::200e
```

Why IPv6?

* IPv4 addresses are limited
    
* IPv6 provides many more addresses
    

![https://images.ctfassets.net/aoyx73g9h2pg/qJoE9tXXXxCUYiB3bfXqq/c08ab6877b63f412d8c2957b28dccc8f/What-is-an-AAAA-record-Diagram.jpg](https://images.ctfassets.net/aoyx73g9h2pg/qJoE9tXXXxCUYiB3bfXqq/c08ab6877b63f412d8c2957b28dccc8f/What-is-an-AAAA-record-Diagram.jpg align="left")

![https://media.licdn.com/dms/image/v2/D5612AQEFgI8SshpAkA/article-cover_image-shrink_720_1280/article-cover_image-shrink_720_1280/0/1687357981319?e=2147483647&t=i2jfUYrLZUilAU_DjAS3x6MdgUnr8l5p15mu_j4pZm0&v=beta](https://images.openai.com/static-rsc-1/88ekIAySy-tn3lAz0cSYXOn4AOQ-DvJyYPMm7VlKYf0mZIC3fW8W1KP0xiFJvvQ7sMIE_jh3pqtetHnPS1yW4TRcJRFU1NGbL0K78fVya8oHsL59pO8WURS-JAmV9OKHVaMzg6oT59MDpkO5lRh4HA align="left")

Modern systems prefer IPv6 if available.

---

## What Is a CNAME Record? (Name Pointing to Name)

**CNAME = Canonical Name**

A CNAME record points:

```plaintext
one domain name → another domain name
```

Example:

```plaintext
www.example.com → example.com
```

This means:

* [`www.example.com`](http://www.example.com) does not have its own IP
    
* It uses whatever IP [`example.com`](http://example.com) has
    

![https://www.keycdn.com/img/support/cname.png](https://www.keycdn.com/img/support/cname.png align="left")

![https://www.mailersend.com/img/containers/gcs/blog/blog-dns-cname-graph2-min.png/949e2350d7206bb5e12cf1d4db6eaa11.webp](https://www.mailersend.com/img/containers/gcs/blog/blog-dns-cname-graph2-min.png/949e2350d7206bb5e12cf1d4db6eaa11.webp align="left")

**Why CNAME is useful:**

* Easy management
    
* One place to change IP
    
* Subdomains stay updated automatically
    

---

## What Is an MX Record? (Email Routing)

**MX = Mail Exchange**

MX records tell the internet:

> “Where should emails for this domain be delivered?”

Example:

```plaintext
example.com → mail.google.com
```

When someone sends:

```plaintext
hello@example.com
```

DNS uses MX records to find the **mail server**.

![https://assets.gcore.pro/site-media/uploads-staging/dns_mx_record_explained_1_f3b4de8869.png](https://assets.gcore.pro/site-media/uploads-staging/dns_mx_record_explained_1_f3b4de8869.png align="left")

![https://www.techfry.com/images/webmaster/mx-record-working.jpg](https://www.techfry.com/images/webmaster/mx-record-working.jpg align="left")

Without MX records:

* Emails will not reach your domain
    

---

## What Is a TXT Record? (Extra Information & Verification)

**TXT = Text**

TXT records store **extra information**.

Common uses:

* Domain ownership verification
    
* Email security (SPF, DKIM, DMARC)
    
* Third-party service verification
    

Example:

```plaintext
google-site-verification=xyz123
```

![https://www.codetwo.com/media/images/1018-1-spf-verification-diagram.jpg](https://www.codetwo.com/media/images/1018-1-spf-verification-diagram.jpg align="left")

![https://www.mailhardener.com/images/gcloud_dns_2.PNG](https://www.mailhardener.com/images/gcloud_dns_2.PNG align="left")

TXT records do not affect website loading directly,  
but they are very important for **security and trust**.

---

## How All DNS Records Work Together (One Website)

Let’s take one example:

```plaintext
example.com
```

![https://library.mosse-institute.com/_images/dns.png](https://library.mosse-institute.com/_images/dns.png align="left")

![https://miro.medium.com/0%2Aw4_IIjmSUdtMp-hT](https://miro.medium.com/0%2Aw4_IIjmSUdtMp-hT align="left")

### Step-by-Step Flow

1. **NS Record**
    
    * Finds who manages the domain
        
2. **A / AAAA Record**
    
    * Finds the server IP
        
3. **CNAME**
    
    * Handles subdomains like `www`
        
4. **MX Record**
    
    * Routes emails
        
5. **TXT Record**
    
    * Verifies ownership and security
        

Each record has **one job**, and together they make the website work.
