Skip to main content

Command Palette

Search for a command to run...

DNS Record Types Explained

Updated
8 min read
DNS Record Types Explained
D
"Hello, I am Dipali. Currently a student of ChaiCode web development cohort✨"

Introduction

From the moment we wake up, data plays the important role in our life. we spent most of our time in our phone, laptops or the devices who connect to the internet.

Let just say, this weekend a new movie is being released and you want to watch that movie in theater. How you gonna book the ticket, simple by using BookMyShow website. So you go to your browser type bookmyshow.com website and book your ticket easy right. But the question is

“How does your browser know where a BookMyShow website lives?”

You thing you type URL and browser directly connects you the Website in seconds, but that’s not true.

So, let me explain what happen then

When you type the URL (bookmyshow.com) the browser sends a request to the DNS (Domain Name System) to find the IP (Internet Protocol) address of website BookMyShow.

What is DNS

DNS is stands for Domain Name System. It is the phonebook of the internet, just like we save numbers in our devices. So, people like us search for information simply by website names (example, bookmyshow.com, google.com, youtube.com) rather than remembering there IP addresses.

But why we need DNS

Because computers or your devices don’t understand the names like bookmyshow.com or google.com, etc. They only understand the numbers called IP addresses.

So, when you search for the website your browser ask the DNS where is this website live , then DNS go and look in his phonebook and gives browser to the IP Address of this website then your browser connects you to that website.

Browser → DNS → Server (high-level flow)

Why DNS records are needed ?

DNS records are internet's translation service and instruction manual for your domain. They convert names (like google.com) to numeric IP addresses, ensuring that users are routed to the correct web server. Beyond simple routing, they provide specific services like email through MX records and verify domain ownership or security protocols through TXT records. By distributing these instructions across a global network, DNS records enable fast, reliable, and secure connections for websites and applications worldwide.

What an NS Record is (who is responsible for a domain) ?

The NS is stands for ‘nameserver’ and the nameserver record tell as who is responsible for managing DNS for a particular domain, the internet where to go and find out a domain’s IP address.

The NS records connects your domain register (like GoDaddy or Hostinger) to your DNS hosting provider (like Cloudflare or DigitalOcean).

An Example

If you look up bookmyshow.com, the .com TLD (Top-Level Domain) servers will return NS records Pointing to Cloudflare’s nameservers (like tori.ns.cloudflare.com ). Your computer then asks those servers for the actual IP address.

Command:

dig bookmyshow.com NS

Output:

  • status: NOERROR: This is great news. It means the DNS query was successful and the domain exists.

  • The Question Section: you asked: "What are the Name Servers (NS) for bookmyshow.com?"

  • The Answer Section:

    1. NS Records: It shows that BookMyShow uses Cloudflare to manage its DNS records (tori and coby).

    2. TTL (86400): This is the "Time to Live" in seconds (which equals exactly 24 hours). It tells other servers how long they should cache this information before asking again.

  • Query time: 12 milliseconds—very fast!

What an A Record is (domain → IPv4 address) ?

The A stands for ‘address’ and directly connects a domain name to an IPv4 address. A records only hold IPv4 addresses. This helps user’s device to connect the load a website without remembering their IP addresses.

DNS A records are also used for operating a Domain Name System-based Blackhole List (DNSBL). DNSBLs can help mail servers identify and block email messages from known spammer domains.

Command:

dig bookmyshow.com A

Output:

  • This is how a major site like BookMyShow handles its traffic using A records. Instead of just one address, you received five different IPv4 addresses in the ANSWER SECTION.

  • Because BookMyShow gets massive amounts of traffic, they don't rely on a single server. This is a technique called DNS Load Balancing.

  • When someone visits the site, the DNS resolver can pick any of these five IPs to distribute the "load" across multiple servers.

Domain name to IP mapping using A records:

What an AAAA Record is (domain → IPv6 address) ?

An AAAA record (pronounced "Quad-A") is used to map a domain name to an IPv6 address. IPv4 addresses are 32-bit, while IPv6 addresses are 128-bit.

If you ran dig bookmyshow.com AAAA, you're looking at the IPv6 highway.

Command:

dig bookmyshow.com AAAA

Output:

  • The Addresses: The2606:4700 it’s indicates that BookMyShow is likely using Cloudflare as their DNS and Content Delivery Network (CDN) provider.

  • Redundancy: By providing five different IPv6 addresses, they ensure that if one server or path is congested, your device has four other options to try.

Domain name to IP mapping using AAAA records:

What a CNAME Record is (one name pointing to another name) ?

A CNAME is a Canonical Name Record, in simple words it’s a way to point one domain name to another domain name instead of pointing it directly to an IP address.

Let just think a CNAME record is a forwarding address. If you have multiple services hosted at the same location, you don't want to manage the IP address for every single one of them. Instead, you point them all to a single "main" domain.

Command:

dig bookmyshow.com CNAME

Output:

CNAME pointing one domain name to another

A vs CNAME

FeatureA Record (Address)CNAME Record (Canonical Name)
Points ToAn IPv4 AddressAnother Domain Name
Primary GoalMaps a name to a physical server.Maps a nickname to an existing domain.
Root DomainYes. Required for yourdomain.com.No. Generally not allowed for root domains.
Resolution SpeedFast. One-step lookup to find the IP.Slightly Slower. Requires at least two lookups.
MaintenanceHigher. If the server IP changes, you must manually update the record.Lower. If the target IP changes, the CNAME updates automatically.
Multiple RecordsCan have multiple A records for one name (Round Robin).Can only point to one target domain name.
CoexistenceCan exist alongside MX or TXT records.Cannot coexist with other records for the same hostname.

What an MX Record is (how emails find your mail server) ?

An MX Record (Mail Exchanger) It is a type of DNS record that tells the internet which mail server is responsible for accepting email messages. It is responsible for email delivery

Without an MX record, other mail servers (like Gmail or Outlook) wouldn't know where to send messages addressed to @bookmyshow.com.

Command:

dig bookmyshow.com MX

Output:

  • Priority (The numbers 1, 5, 10): the lower numbers mean higher priority.

    The server aspmx.l.google.com has a priority of 1, making it the primary server.

    If that fails, it moves to the servers with priority 5, and so on.

  • Mail Servers: You can see the bookmyshow are using Google Workspace (Gmail) to host their business email, indicated by the google.com and googlemail.com addresses.

  • MX records point to domain names and not IP addresses, the DNS server provides the A records (IPv4) and AAAA records (IPv6) for those mail servers.

    Example: aspmx.l.google.com is located at IP 142.250.4.27.

Email routing using MX records

NS vs MX

FeatureNS Record (Nameserver)MX Record (Mail Exchanger)
What it doesIdentifies which servers manage all the DNS records for your domain.Specifies the server responsible for receiving emails.
RoleThe "Manager" or "Address Book."The "Post Office."
ScopeGlobal: Controls everything (Web, Email, FTP, etc.).Specific: Controls only incoming email.
Key FieldServer Name (e.g., ns1.google.com).Priority Number + Server Name.
PriorityNo priority numbers (all are usually active).Uses Priority (lower number = try first).
If it breaksYour entire website and email go offline.Your website stays up, but you can't receive emails.

What a TXT Record is (extra information and verification) ?

A TXT record is a TeXT record and it store the extra information about a domain. TXT records don't "do" anything on their own. Instead, they provide information to external services or servers.

Command:

dig google.com TXT

Output:

  • Ownership Verification: * Google: Several google-site-verification records are present to link the domain to Google Workspace (gmail).

    • Facebook: facebook-domain-verification is used for managing business assets on Meta.

    • Amazon SES: amazonses allows them to send emails using Amazon's Simple Email Service.

    • Microsoft: Records starting with MS= or ms are for verifying the domain with Microsoft 365 or Azure.

  • Security & Safety:

    • Have I Been Pwned: The have-i-been-pwned-verification allows the site to use the HIBP API to check if their users' credentials have been leaked in data breaches.
  • Email Authentication (SPF):

How all DNS records work together for one website

  1. User types: www.bookmyshow.com

  2. DNS checks NS → finds authoritative DNS servers.

  3. Reads A / AAAA (or CNAME → A) → gets server IP.

  4. Browser connects to that IP → website loads.

  5. If user sends email to @bookmyshow.com:

    • Mail server checks MX

    • Verifies sender with SPF/DKIM/DMARC (TXT)

  6. Security & ownership are validated using TXT.

One complete DNS setup for a bookmyshow.com

Diagram:

Image:

Conclusion

DNS records play an important role in the functioning of the internet by translating domain names into IP addresses. They ensure that users are directed to the correct web servers and provide additional services like email routing and domain verification.

Understanding different DNS record types, such as NS, A, AAAA, CNAME, MX, and TXT, helps in managing domain settings effectively, ensuring fast, reliable, and secure connections for websites and applications. By working together, these records facilitate seamless internet navigation and communication.