# DNS Record Types Explained

## How does a browser know where a website lives?

When you type a website name like [google.com](http://google.com) into your browser, do you know how the browser knows where that website actually lives? Computers don’t understand website names. They understand IP addresses. So how does your browser convert a human-friendly name into a server location? The answer is DNS.

## What is DNS? (Phonebook analogy)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769539533070/28aad35d-3618-43e3-b238-8de684a68bc1.png align="left")

DNS stands for Domain Name System. DNS is like the phonebook of the internet. Just like a phonebook converts a person’s name into a phone number, DNS converts a website name into an IP address. That's it like **hashnode.com** into an IP(**142.250.190.14**).

## Why DNS records are needed

DNS records store information about a domain.

They tell the internet

*   Where the website is hosted
    
*   Who controls the domain
    
*   Where emails should be delivered
    
*   Extra verification details
    

## What is an NS Record?

NS(Name Server) records tell the internet who is responsible for a domain.

Think of NS records like the post office for your area. They tell where to ask for the correct address information. example.com → ns1.dnsprovider.com

## What is an A Record?

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769539988407/1714d780-92e2-4fc2-81b9-4889ac29f587.png align="left")

An A record connects a domain name to an IPv4 address.

This is the most important DNS record for a website. example.com → IP(93.184.216.34)(IPv4)

## What is an AAAA Record?

An AAAA record is similar to an A record, but it points to an IPv6 address instead of IPv4.

## What is a CNAME Record?

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769540085021/3166d3a0-98fa-444c-b1e6-fd6d51d80579.png align="left")

A CNAME record points one domain name to another domain name.

It acts like a nickname(gharelu name :)). www.example.com → example.com

## What is an MX Record?

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769540177528/bbfeb069-e580-47dc-a9cf-b083618d3149.png align="left")

MX (Mail Exchange) records tell where emails for a domain should be delivered.

example.com → mail.google.com

## What is a TXT Record?

TXT records store extra information about a domain.

They are commonly used for:

*   Domain verification
    
*   Email security (SPF, DKIM)
    
*   Ownership proof
    

"v=spf1 include:\_spf.google.com ~all"

## How DNS records work together for one website

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769540527943/118cf8ed-a25b-4d03-bbd3-464acfe207fa.png align="left")

example.com uses:

*   NS record → tells who manages DNS
    
*   A record → tells where website is hosted
    
*   CNAME → points www to main domain
    
*   MX record → handles emails
    
*   TXT record → verifies domain ownership
    

One domain = multiple DNS records working together

## Common Confusions (A vs CNAME, NS vs MX)

“A” Record vs CNAME

“A” record → domain → IP

CNAME → domain → another domain

NS vs MX

NS → who manages DNS

MX → where emails go

DNS is a system of records that tells the internet:

*   Who manages a domain
    
*   Where the website lives
    
*   Where emails should be delivered
    

DNS may look complex at first, but it becomes simple when you understand what problem each record solves.

Each DNS record has a clear responsibility, and together they help the internet find websites and deliver emails correctly.

Once you understand DNS records, debugging website and email issues becomes much easier.

I hope you understand about the DNS, If you would like to read like these type of articles, read out about the [TCP vs UDP](https://devwithsantosh.hashnode.dev/tcp-vs-udp-when-to-use-what-and-how-tcp-relates-to-http). You may also connect me from [LinkedIn](https://www.linkedin.com/in/devsantoshkumar/).

Thank you for reading this article.
