# DNS Record Types Explained

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

* when we open any website on our browser, the browser does not magically know where that website is stored. computer do not understand human-friendly names like “chaicode.com“ they only understands IP address, which looks like this `192.168.10.1` . which is very hard to remeber for a human, So the very first thing our browser need to figure out is where this website actually lives on the internet , to solve this problem DNS came into the picture let’s deep dive into it.
    

### DNS : The Big Phonebook of the Internet

DNS stands for <mark>Domain Name System </mark> . The simplest way to understand it is to think it as the phonebook of the internet

* Computer only understands Numbers (ip addresses).
    
* Human are able to remember the names of the website not the ip address (like `chaicode.com`)
    

DNS bridges this gap by automatically translating the name you type into the numbers that computer understand

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769693940643/2816ad21-9cb7-4ac9-b0fb-f7b6fc70ff12.png align="center")

without DNS , we have to remeber the ip address of each website to access it which is practically not possible for a human to remember all the ip addresses, hence DNS made our task very easy that why we just have to type the website names to get its access.

### Why we need DNS records?

* simple answer is without these records we have to remember the ip address to access the website , basically they tell the internet where to find a website
    
* DNS isn’t just one big list. It is a collection of specific records, where each record answers a specific question about a domain.
    

### Different DNS records :

1. <mark>NS Record</mark> (Name Server)
    
    NS records tells the internet to determine which name server is authoratative for a particular domain;. In simpler terms, if we buy a domain name for website from any provider like <mark>shubhujalablogs.live </mark> , the NS recors tells us which company owns or manage that domain , it points the name server of that company then the name server provides the IP address of the website. (in my case it is cloudflare).
    
    * Question it answers : Who is incharge here?
        
2. <mark>A Record</mark>
    
    A record also known as address record, it is used to map the domain name directly to an IPv4 address
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769694791510/826cad35-b6a4-4369-94dc-a3ace7cf077f.png align="center")
    
    * Question it answers : where is the website hosted?
        
3. <mark>AAAA Record</mark>
    
    It is introduced because we actually ran out of standard IPv4 address, IPv6 was created to solve this problem . AAAA record does the same job as the A record but for the IPv6 address.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769695202550/0e166abd-9ed0-4a31-8015-9f762c017c47.png align="center")
    
    * Question it answers : where the website hosted? for IPv6 networks
        
4. <mark>CNAME Record</mark>
    
    Some time we want multiple names to point to the same location , basically CNAME acts as a nickname . Instead of pointing to an IP address (like A record), CNAME points to another domain name, it basically says “I don’t know the IP, but you can ask the this guy“
    
    * Question it answers : is this alias for another domain?
        
5. <mark>MX Record</mark>
    
    if you send an email , the internet is going to look for the MX Record. for browser it was A record, MX records often have priorities (number like 20,30). lower the number, higher the priority.
    
    * Question it answers : where should email be delievered?
        
6. <mark>TXT Record</mark>
    
    TXT records are like sticky notes attached to your domain they provides information, mostly used for the security and verifications.
    
    **Example** → v= spf1 include:\_[spf.google.com](http://spf.google.com) ~all
    
    it allows specific mail servers to send emails for the domain.
    

So , these are all the common records and there usescases

---

Hope you enjoyed reading.
