# DNS Record Types Explained

## What DNS is ?

Do you have ever wondered how browser find different sites. When you type [facebook.com](http://facebook.com)/ [google.com](https://www.google.com/) into your browser and press Enter, the page opens in just a few seconds.

But browsers don’t understand website names like [facebook.com](http://facebook.com)/ [google.com](https://www.google.com/). It only understand **IP addresses**, which are numbers(e.g., 192.168.1.1). Since humans aren't great at memorizing random numbers, we created **DNS.**

DNS stands for **Domain Name System**. Simply put, DNS is like a guide that knows the addresses of websites on the Internet.It gives us IP addresses behalf of website names. So you can say Instead of remembering IP addresses, humans use readable domain names, and DNS converts them into something machines understand.

How it works is a another story we will talk about is later in a different blog.

## **Why Are DNS Records Needed?**

DNS is not a single database. It works through **DNS records**, which are configuration entries associated with a domain.

Each DNS record answers a specific question, such as:

* Who manages this domain?
    
* Where does the website live?
    
* Where should emails be delivered?
    
* Is this domain verified?
    

Together, these records allow internet traffic to reach the correct destination.

## **What Is an A Record?**

### **Problem it solves:**  
Where is the website server?

This record contains the IP address for a domain and is the heart of any domain. It maps a domain name to an IPv4 address so browsers know where to connect. It works with IPv4 addresses.

In simple terms, if you ask for the address of [example.com](http://google.com), it will give you 142.250.206.142(which is a IPv4 address of example.com).

![Zoomed view](https://cdn.hashnode.com/res/hashnode/image/upload/v1769621264119/4b964b15-5e25-4659-9fd0-763c8a8df81f.jpeg align="left")

---

## **What Is an AAAA Record?**

### **Problem it solves:**  
Same as A record, but for newer IP addresses.

As technology advances, the number of devices has increased, but the old IPv4 addresses have reached their limit and it **ran out of available addresses**. To solve this problem, a new type of address was introduced.

The **IPv6 address**, which is a combination of **hexadecimal** with a 128-bit system. To handle this new type, **AAAA Records** were introduced. They work the same as A Records, connecting a domain name to an IPv6 address. It allows websites to be accessed over IPv6-enabled networks

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769623221261/a3b980b1-f3e6-4292-9ab2-b4379e6ed3fc.jpeg align="left")

---

## **What is an NS Record?**

### **Problem it solves:**  
Who is in charge of this domain?

NS stands for **Name Server**. It helps us identify who is responsible for a domain. For example, if you have a domain, you likely purchased it from a provider like Namecheap, Squarespace, or Hostinger. These companies adds NS records by default, so they handle all the queries.

Here's how it works if you search for [**example.com**](http://example.com). First, it asks the root server and then **TLD** (top-level domain), which in this case is **.com**. The TLD will say it doesn't know the IP address, but the Name Server will. So, it directs the DNS to ask the Name Server.

***In simple words ,which servers are responsible for answering DNS questions for a particular domain.***

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769613239799/8f769c09-1eef-4e25-933c-70a54972166e.jpeg align="left")

### **Real-life example**

Think of an apartment building.

* The **security desk** knows where every flat is
    
* Visitors must ask the security desk first
    

NS records are like that security desk.

Without NS records, no one knows where to ask about your domain.

---

## **What Is a CNAME Record?**

### **Problem it solves:**  
Avoid managing multiple IP addresses.

A **CNAME** record stands for **Canonical Name** and is used to create an alias for a domain. It allows one domain or subdomain to point to another domain name instead of an IP address. This is commonly used when hosting a website on third-party services like Netlify or Vercel, where you connect your custom domain by adding a CNAME record

**In simple words**,A **CNAME** record points one domain name to another domain name.

For example, if you have a domain like [`example.com`](http://example.com), you can add a CNAME for [`blogs.example.com`](http://blogs.example.com) that points to your Hashnode domain.

![Zoomed view](https://cdn.hashnode.com/res/hashnode/image/upload/v1769625405409/46513947-546f-429e-a6c5-0b303ed6988c.jpeg align="left")

### **Real-life example**

* Nickname → official name
    
* “Call me AK” → Ayan Kumar
    

### **Common beginner confusion: A vs CNAME**

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

Always remember a CNAME never points directly to an IP.

---

## **What is an MX Record?**

### **Problem it solves:**  
Where should emails be delivered?

MX stands for **Mail Exchange**. This record is useful for sending and receiving emails for your domain. It tells other mail servers where to deliver emails. That's why this record exists.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769626558925/ff544983-13c9-4853-9b44-a21079373356.jpeg align="left")

### **Real-life example**

Think of an **MX record** like a post office address list. When someone sends you a letter (email), the MX record tells the post office which mailbox (mail server) should receive it first.

---

## **What Is a TXT Record?**

A **TXT record** stores plain text information for a domain. It is mainly used to verify domain ownership and to add security rules emails.

Think of a TXT record like a note attached to your domain that tells other services, “Yes, this domain is real”

A **TXT record** can contain:

* Google site verification
    
* Email security rules (SPF, DKIM, DMARC)
    
* Ownership proof
    

---

## **How all DNS records work together for one website**

Let’s take a simple website: [**example.com**](http://example.com)

1. **NS records** say who manages DNS
    
2. **A / AAAA records** point to the web server
    
3. **CNAME record** maps `www` to the main domain
    
4. **MX records** handle emails
    
5. **TXT records** verify and secure services
    

All of them work together to make:

* Website loading
    
* Emails delivered
    
* Services trusted
    

Remove one, and something breaks.

---

## **Conclusion**

DNS might feel confusing at first, but at its heart, it’s just:

> ***A well-organized phonebook that helps the internet find things.***

Once you understand what problem each record solves, DNS becomes much less scary and much more logical.
