# DNS Record Types Explained

To learn about the DNS records , let’s first learn a little about the DNS itself, the way we navigate through the internet — the map.

If we consider DNS as the map of the internet, DNS records are what actually guide the path of our requests. They help us route traffic on the internet using domain names and IPs.

### Why DNS records are needed?

DNS records help route traffic and guide users/ requests to where we want to direct them, in an easy and organized way.

They also ensure that this routing happens properly and help avoid errors by allowing flexibility when things change.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1768997756025/b65063a3-3199-4631-8a52-a39997eb4377.png align="center")

### Commonly used records —

Starting from `CNAME` , as that’s what we may usually enter while browsing on the internet. If we consider above example —

**CNAME** —

```plaintext
blog.somename.dev  →  CNAME  →  hashnode.network
```

If we add an alias `blog.somename.dev` for `hashnode.network`.  
When requests come to blog.somename.dev, checks the given `CNAME` record. After that, the request is directed to the next record, which is hashnode.network.

`CNAME` , also helps in cases where there the `A record` changes , in such case since it points to a `name` not `IP`, request is automatically directed to new IP.

But, `All of this happens only after DNS knows where to look`. which we get from the `NS record`.

**NS record** —

tells us which DNS provider to check with for a domain or which servers are authoritative for a domain. Once resolved, DNS can look for other records `CNAME`, `A`, `AAA` .

**A / AAAA record** —

point the domain to the machine (1.23.4.5), so the browsers can reach the website. A and AAAA records **work the same way** —

* A - IPv4 addresses
    
* AAAA - IPv6 addresses
    

Both return the IP of the machine where the actual data (website) lives.

**MX record** —

If Zoho gives us an MX record, we add it in our DNS. Now, all mails sent to `@somename.dev` will be delivered to zoho’s mail servers

```plaintext
somename.dev   MX   mx.zoho.com
```

**TXT records** —

provides information about our domain, improving email security

* **SPF:** Who can send emails from your domain
    
* **DKIM:** Proves email authenticity
    
* **DMARC:** Tells others what to do with emails that fail SPF/DKIM
    

**Together, these protect your domain from spam and phishing.**
