DNS Record Types Explained.

i was a nobody until the covid-19 and like most of the devs from this covid-19 wave, i too started learning something to transition from that nobody to somebody/someone because i had some spare time during π & after all those online classes.
so fast-forward β© to 2025 i am currently a frontend developer who
- is still learning basics of javascript
- primarily uses CSS for styling
- ships a couple of apps every now and then
- uses react.js as the primary framework
impact:
- Sep,2022 developed the first website aka current one for MuLearn Foundation
- 2023 developed the web app for MuLearn Foundation, used by over 30,000+ students
- 2024 - present co-founded the event management and ticketing platform makemypass.com along with few sub-products such as hoogo, premote, quizit, jusvote, leadx
- 2025 - present working at ente.io
Have you ever hosted a real website? If so, you've probably seen or forwarded an A Record. But chances are you never searched WHAT IT IS. So let me introduce you to a few such records.
How did you reach here?
You entered a URL in the browser and voilΓ , you're here.
BUT HOW DID YOU REACH HERE?
Most folks don't have an answer because this happens automatically. The browser somehow knows where the website lives, went there, and got you the content.
So how does a browser know where a website lives?
hashnode is just a nickname, not the original name.
Wait what? It's not the real name? Then how is the whole brand built around this NAME?
What i meant was hashnode is just a nickname for the browser. It actually knows the real name of hashnode. So if there's a real name, why aren't we using it?
Because the original name is NOT easy to remember.
It's something like 66.33.60.129 - that's the ORIGINAL NAME for hashnode.com. You might say you'll remember this, but imagine using 100 websites daily and having to remember 100 random numbers. What are the odds of you MESSING IT UP?
Pretty high, right?
This is why browsers use hashnode.com (the nickname) and make our lives easier.
For now, just imagine the browser has a phonebook with this mapping. Let's call this mapping DNS.
1. Browser β DNS β Server (High-level flow)
βββββββββββ "Where is asw.in?" βββββββββββ
β Browser β ββββββββββββββββββββββββββββββ> β DNS β
βββββββββββ βββββββββββ
β β
β β Looks up record
β βΌ
β "192.168.1.1"
β IP: 192.168.1.1 β
β <ββββββββββββββββββββββββββββββββββββββββββ
β
β Connect to server
βΌ
βββββββββββ
β Server β (at 192.168.1.1)
β asw.in β
βββββββββββ
The A Record
Back to our A Record - what does it do in this whole process?
In simple words, this is the record that actually gives the browser the IP ADDRESS when the browser provides the nickname or domain name.
The A record resolves the domain to the IP Address (IPv4).
Example:
asw.in A 192.168.1.1
When you visit asw.in, the browser gets the IPv4 address 192.168.1.1 and connects to that server.
2. Domain name to IP mapping using A / AAAA records
Domain Name DNS Record IP Address
ββββββββββββ ββββββββββββ ββββββββββββββββββββ
β asw.in β βββAββββ> β DNS 0 β ββββββββ> β 192.168.1.1 β
ββββββββββββ β Server β β (IPv4) β
ββββββββββββ ββββββββββββββββββββ
β
ββββββββββββ β ββββββββββββββββββββ
β asw.in β ββAAAAβββββββββββ β 2001:0db8:85a3 β
ββββββββββββ β ::8a2e:0370 β
β (IPv6) β
ββββββββββββββββββββ
The AAAA Record
The AAAA Record also resolves to an IP address, but instead of IPv4, it's IPv6.
Example:
asw.in AAAA 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Same domain, but now with an IPv6 address for modern networks.
The CNAME Record
Unlike the above records where A and AAAA resolved to IP addresses, the CNAME actually resolves to another domain. Basically just like a redirection.
Like when you visit youtube.com, you're probably redirected to www.youtube.com where www is a subdomain.
A CNAME is like a shortcut name that takes you to the real place.
Example:
www.asw.in CNAME asw.in
blog.asw.in CNAME hashnode.network
When you visit www.asw.in, it points to asw.in. When you visit blog.asw.in, it points to hashnode.network.
3. CNAME pointing one domain name to another
User types CNAME Record Final Resolution
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β www.asw.in β ββββ> β CNAME β ββββ> β asw.in β
ββββββββββββββββ β www β asw.in β ββββββββββββββββ
ββββββββββββββββ β
β A Record
βΌ
ββββββββββββββββ
β 192.168.1.1 β
ββββββββββββββββ
Another example:
ββββββββββββββββ ββββββββββββββββββββ ββββββββββββββββββββ
βblog.asw.in β ββββ> β CNAME β ββββ> β hashnode.network β
ββββββββββββββββ β blog β hashnode β ββββββββββββββββββββ
ββββββββββββββββββββ
The MX Record
Say i have a domain asw.in and you ask me for my email address. I give you mail@asw.in.
When you send a mail to this address, the sender's mail server asks DNS: "Hey, where should I deliver mail for asw.in?"
DNS looks at the MX record and replies:
asw.in MX 10 mail.asw.in
This tells the internet: "All emails for @asw.in should be delivered to mail.asw.in"
Example:
asw.in MX 10 mail.google.com
asw.in MX 20 backup-mail.google.com
The number (10, 20) is priority - lower number = higher priority. So emails go to mail.google.com first, and if that fails, they try backup-mail.google.com.
4. Email routing using MX records
Email to: user@asw.in
β
βΌ
βββββββββββ "Where do emails for
β Sender β asw.in go?"
β Mail β βββββββββββββββββββββββββββ> βββββββββββ
β Server β β DNS β
βββββββββββ βββββββββββ
β β
β β Checks MX records
β βΌ
β MX 10 mail.google.com
β MX 20 backup-mail.google.com
β Priority 10 (try first) β
β <βββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββ
β mail.google.com β (Primary mail server)
ββββββββββββββββββββ
β (if fails)
βΌ
ββββββββββββββββββββββββ
β backup-mail.google β (Backup mail server)
ββββββββββββββββββββββββ
The TXT Record
This record defines miscellaneous information.
Say Google needs to confirm: "Do you actually own asw.in?"
They give you:
asw.in TXT google-site-verification=abc123xyz
Once Google sees this β domain verified. (You can delete it later, but most people keep it.)
Example:
asw.in TXT "v=spf1 include:_spf.google.com ~all"
asw.in TXT "google-site-verification=abc123xyz"
The first one tells email servers "only Google's servers can send emails from @asw.in" (prevents spam). The second verifies domain ownership for Google Search Console.
The NS Record
NS (Name Server) records tell the internet which servers are authoritative for your domain.
Example:
asw.in NS ns1.cloudflare.com
asw.in NS ns2.cloudflare.com
5. Simple DNS hierarchy showing NS records
ββββββββββββββββ
β Root DNS β
β Servers β
ββββββββββββββββ
β
β "Who handles .in domains?"
βΌ
ββββββββββββββββ
β .in TLD β
β Servers β
ββββββββββββββββ
β
β "Who handles asw.in?"
βΌ
βββββββββββββββ-β
β NS Records β
β ns1.cloudflareβ
β ns2.cloudflareβ
βββββββββββββββ-β
β
β "What's the A record for asw.in?"
βΌ
ββββββββββββββββ
β Authoritativeβ
β DNS Server β
β (Cloudflare)β
ββββββββββββββββ
β
βΌ
Returns: 192.168.1.1
Complete DNS Setup Example
6. One complete DNS setup for a small website
Domain: asw.in
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DNS Records Setup β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β NS Records (Nameservers) β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β asw.in NS ns1.cloudflare.com β β
β β asw.in NS ns2.cloudflare.com β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β A Records (Main domain) β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β asw.in A 192.168.1.1 β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β CNAME Records (Subdomains) β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β www.asw.in CNAME asw.in β β
β β blog.asw.in CNAME hashnode.network β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β MX Records (Email) β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β asw.in MX 10 mail.google.com β β
β β asw.in MX 20 backup.google.com β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β TXT Records (Verification & SPF) β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β asw.in TXT "v=spf1 include:_spf..." β β
β β asw.in TXT "google-site-verification..."β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Result:
β asw.in β 192.168.1.1
β www.asw.in β 192.168.1.1 (via CNAME)
β blog.asw.in β hashnode.network
β user@asw.in β mail.google.com
β Domain verified for Google services



