Skip to main content

Command Palette

Search for a command to run...

DNS Records

Different phone numbers in the internet phonebook (DNS)

Updated
4 min read
DNS Records

When you type yogeshkumar.site in your browser, how does it know exactly where my website’s servers are located?

The protocol that maps a domain name of the website to its IP Address is called DNS. For more on this, read my previous blog on DNS resolution.

In short, Browser → Recursive DNS Resolver → Root Server → TLD Server → Authoritative Server. Simply DNS works like asking for directions in a big Mall, like Ambience Mall.

There can be many phone numbers for an address for different people living at the same address, or different phone numbers for the given address as well, so are the DNS Records for different lines of communication to a singular server on the internet, maybe a business number, a personal number, or you can assume different phone numbers for the different phones.

Different records are used for different purposes; that’s how a delegation for the domain.

NS Record is the pointer in the DNS that tells where to go next to find the IP address of a particular domain name, while there is a resolution for the DNS query from the recursive DNS resolver. It’s like asking the security in the mall for the floor of the PVR.

A record stands for the address of the particular domain name means the IP address. It’s like your house number in the whole street and the whole colony for the postman and the address of India.

As different maps on mobile devices use different methods of mapping a location, there are two types of IP addresses as well: A record for IPv4 addresses and AAAA records for IPv6 addresses for the particular domain name in the DNS. AAAA are like a map at the mall, which shows the shop number and floor for the Halidrams in the mall.

CNAME record stands for the canonical name of the A record, which means an alias. It’s like you have a professional name and a nickname for the home and relatives. And every CNAME points to a domain name.

MX record is a Mail Exchange record and is required to set up to direct your mail to your mail server. Consider your house as your mail server and your address and mx record for it for you to receive mail or post from the post office. You tell the post office where you can be found, and mail can be stored at this location. It is used for mailing purposes only.

TXT record stand DNS text record, and it shares a string of text within ““ quotes from the domain administrator. It is like sticky notes on the domain name servers. Today, these are used for the verification of the email spam protection.

If there are so many records and few of them are listed above, how do they work together for a domain name? A record for the IP address of the authoritative name server, NS for the directions to the name server, and MX routes the emails to the mail server of the domain. CName acts as a nickname whenever there is a change in the A/AAAA records and TXT for verification.

In simple terms, if a domain name is your home, then an A record is the address, AAAA is the highly specified addresses with coordinate details, like a name plate, CName is the nickname to your house, like Kumar’s House, and NS is the pointer to the house address, like a corner shopkeeper telling the direction to home. MX is the courier service, and TXT record is the security guard.

Don’t confuse A and CName; one is the actual name, and the other is the nickname. SImilarly for the NS and MX, as the former is for the directions to find the home, and the latter is the actual address for the mail.

  • A vs CNAME: One is a direct address, one is a nickname

  • NS vs MX: One manages DNS info, one manages email

DNS visualised for yogeshkumar.site, 
yogeshkumar.site (Your Digital Home)
├── 🏠 MAIN ENTRANCE (A/AAAA Records)
│   ├── Street Address: 104.21.36.32 & 172.67.184.86
│   └── GPS Coordinates: 2606:4700:3032::6815:2420 & 2606:4700:3035::ac43:b856
│
├── 📚 SPECIAL SECTION (CNAME Record)
│   └── blog.yogeshkumar.site → "Go to the Hashnode Library"
│
├── 📬 MAIL DELIVERY (MX Records)
│   ├── Primary Post Office: Zoho (priority 10)
│   ├── Backup Post Office: Registrar servers (priority 10-20)
│   └── Emergency Post Office: Additional Zoho (priority 50)
│
├── 🔒 SECURITY NOTES (TXT Records)
│   ├── "Only accept mail from Zoho servers"
│   └── "Only accept mail from Registrar servers"
│
└── 📋 DIRECTORY MANAGER (NS Records)
    ├── Primary Manager: delilah.ns.cloudflare.com
    └── Backup Manager: scott.ns.cloudflare.com

Hence, the setup for the digital home. Mine is at yogeshkumar.site