Understanding The Most Used DNS Record Types and IT'S Use Case

How Browser Knows Where The Website Live
To visit your friend house you need home address of your friend . like this browser need Internet address to visit any website which is called IP address which provide by DNS Server by querying with many other DNS server. so this process is called recursive in nature.
When you type website url or domain name of your favorite website like my favorite (chaicode.com) then bowser look into local cache for IP. if not found it asks DNS Resolver to find the IP. The Resolver asks Root Server (there are 13 logical server identities and 1500 + root server instances distributed globally). The Root Server direct the Resolver to TLD Server which holds address of (.com, .org, .np) . The Resolver query to TLD server to get Authoritative Name Server . The Authoritative Name Server holds the DNS Records (like A , AAAA, CNAME, MX, TXT etc.) and return the final answer to the DNS Resolver and DNS Resolver cache the information and provide to the browser and now browser can send HTTP request to the server to get (HTML, CSS , JS ) and other resources which are important to display webpage.
What is PORT ?
After DNS Resolve , The Port tells your computer which door to knock. At same IP Address many services are running on server . so PORT are the door for specific services like
PORT 80 : for http (web traffic without encryption)
PORT 443 : for https (Secure Web Traffic)
PORT 25 : for SMTP (sending mails)
PORT 22 : SSH (Secure Shell for remote login)
PORT 53 : DNS Queries themselves.
What Are DNS Records Types ?
DNS Record is the file that includes the rules and instruction to link the domain name to IP address which are stored in DNS server. It tells the Internet how to handle the requests for the domain like loading website , sending email or verifying identity.
Each DNS records are text-based file stored on an Authoritative DNS Server that follows specific DNS syntax called zone file and respond to DNS queries. Every Domain have multiple DNS records and each one serves specific purposes. Together, They keep the domain connected, function and secure.
Most Popular DNS Record Explained

A Record (Address Record)
what it does : connect the domain name to IPv4 Address (like 147.185.16.1)
An A Record short for Address record is most fundamental DNS Record type. It maps domain name to IP address especially IPv4 and used in the IP lookup process.
Example :
example.com
A
192.0.2.1
TTL:3600
Use Cases:
pointing domain to web server
connecting sub domain to IP
Load Balancing (multiple A records)
CDN end point configuration
AAAA Record
what id does : Connect you domain name to IPv6 address (like 2000:1a40:3::1)
AAAA records works as A record but it use newer IPv6 address.IPv6 addresses are longer and provide more possible address.
IPv6 addresses are becoming more common because they solve a big problem: IPv4 only has about 4.3 billion possible addresses, but IPv6 has 340 trillion trillion trillion addresses (340 followed by 36 zeros). IPv6 ensures we'll never run out of internet addresses.
Example:
example.com
AAAA
2001:db8::1
TTL: 3600
CNAME Record (Canonical name)
what it does: create alias that point one domain name to another
CNAME let you point the domain or subdomain to another domain name instead of IP address. Acts as Nickname or Alias .
Important note: CNAME records cannot be used for root domains (like example.com) but work perfectly for subdomains like www.example.com or blog.example.com
Example:
www.example.com
CNAME
example.com
TTL: 3600
Use cases:
point WWW to root domain
CDN configuration (pointing to CDN domain)
Subdomain aliases
MX Record (Mail Exchange)
what it does : tells email server to where to deliver Email for your domain. Includes priority value (lower = higher priority)
MX records are essential if you want custom email addresses like yourname@yourdomain.com. They point incoming emails to the right mail server.
How it works :
Someone sends email to
tharu@dipesh.comTheir email system checks MX Record of dipesh.com
The MX Record says send the email to
mail.google.comThe emails get delivered to Goggle’s servers
Priority numbers: MX records include priority numbers (lower numbers = higher priority). This lets you set backup mail servers in case your primary server is down.
Example:
example.com MX 1 ASPMX.L.GOOGLE.COM
example.com MX 5 ALT1.ASPMX.L.GOOGLE.COM
example.com MX 5 ALT2.ASPMX.L.GOOGLE.COM
example.com MX 10 ALT3.ASPMX.L.GOOGLE.COM
example.com MX 10 ALT4.ASPMX.L.GOOGLE.COM
TXT Record (Text Record)
what it does : Stores arbitrary text data. Commonly used for verification, SPF records, DKIM, and DMARC email security.
TXT records are like sticky notes attached to your domain. They hold important text information that other systems can read.
It is most versatile type of DNS record that is used for domain verification , email security (SPF, DKIM, DMARC)
SPF (Sender Policy Framework) :
it defines which mail servers can send email to your domain
DKIM (Domain Keys Identified Mail) :
it verify that email is not altered in transit.
DMARC (Domain Message Authentication, Reporting and Conformance):
it tells receiving mail servers how to handle unauthenticated emails.
Examples:
example.com
TXT
"v=spf1 include:_spf.google.com ~all"
TTL: 3600
NS Record (Name Server)
what id does : specifies authoritative name server for your domain
it points to the name server that are authoritative for your domain. These servers holds the actual DNS record for your domain.
Use cases :
Domain Delegation to DNS provider
Using Custom Nameserver
Subdomain DNS management
It changes propagates slowly (24-48 hours)
Example:
example.com
NS
ns1.example.com
ns2.example.com
TTL: 3600
SOA (Start Of Authority)
what it does : Contains administrative information about your DNS Zone.
SOA records, short for Start of Authority, store important administrative information about a domain or DNS zone, such as the administrator’s email address, server refresh rate, and primary authoritative nameserver.
PTR Record (Pointer Record)
what id does : Performs reverse DNS Lookups (IP address to domain name)
PTR records work backwards from A records. Instead of finding an IP address from a domain name, they find a domain name from an IP address.
Why PTR records matter:
Email deliverability : Many Email servers require PTR records to accepts your email
Security : Help Identify legitimate servers and detect malicious activity
Logging : Make serve logs more readable by sowing domain name instead of just IP Address.
without PTR Records , your email might end up in spam folders or be rejected entirely.
Difference between PTR and MX:
PTR : while sending emails PTR record is critical . without it your email end up to spam or rejected because receiving mail server do reverse DNS lookup check the IP address of the sender points to mail sever like mail.example.com
MX : it is mail box address . It tells server where to deliver Email coming to your domain.
What is TTL in DNS Records ?
TTL stands for Time to Live. It's a number attached to every DNS record that tells other servers how long to cache (or "remember") the record before checking again for changes.
For example, if your A record has a TTL of 3600 seconds, that means DNS servers will remember it for 1 hour before looking it up again.
Why it matters:
A shorter TTL makes updates faster but can increase DNS traffic.
A longer TTL reduces traffic but makes changes slower to appear.
Using DNS Records Types
for example you bought domain name you.com from Hostinger. and you made beautiful portfolio website and host it on Netlify . Netlify gives you url of website like portfolio.netlify.app and you want to add this url to your domain which bought then you have to add the CNAME Record that points to the portfolio.netlify.app . if you want to add mail server then add by using MX record. you can manage subdomain also like blog.you.com and you what to add like Hasnode hosted blogs which you have written then you can do blog.you.com → CNAME → youwriteblog.hasnode.com
you can change Authoritative Name Server by using NS Record then you have to add all the record to Authoritative Name Server suppose you add Cloudflare NS to Hostinger then you have to move all record from Hostinger to Cloudflare.
Summary
DNS records are rules and instructions that help authoritative DNS servers handle DNS queries, making it the foundation on which the internet works.
From basic A records that connect domain names to IP addresses, to advanced security records that protect against attacks, each type serves a specific purpose.
Understanding these DNS record types helps you manage your domain effectively, improve security, and ensure reliable service for your users.




