How Does a Browser Know Where a Website Lives?

Search for a command to run...

No comments yet. Be the first to comment.
When working on Node.js, React, Next.js, or any modern application, one of the first things you'll create is a .env file. It stores everything from database credentials to API keys and authentication

If you’ve ever worked on a college project or a design file, you know the feeling. You finish your work, save it, and then realize you need one tiny change. Suddenly, your folder looks like this: project.zip 📦 project_final.zip ✅ project_final_v2...

What is Git? At its heart, Git is a Distributed Version Control System (VCS). Think of it as a sophisticated "undo" button for your entire project. Unlike a standard "Save" button that overwrites your file, Git keeps a record of every change you make...

Have you ever wondered how clicking a link opens a webpage in seconds? Like, you hit enter on youtube.com, and boom videos. But what’s really happening behind that click is a fascinating digital relay race. Let’s decode the backbone of the internet u...

When you type www.aniketdey.in into your browser and hit Enter, it feels like magic. In a split second, a website appears. But behind the scenes, there’s a frantic game of "connect the dots" happening.
The big question is: How does your browser know where that website actually lives?
The answer is DNS.
Think of the internet as a massive city. Computers are great with numbers, but humans are great with names.
Humans remember: google.com
Computers need: 142.250.190.14 (This is an IP address)
DNS (Domain Name System) is the translator. It’s the internet's phonebook. You look up "Mom" in your contacts, and your phone knows to dial her specific 10-digit number. DNS does the exact same thing for the web.
A phonebook doesn't just list names; it might list a home address, a work number, or an email. DNS records are just different "fields" in that contact card.
Each record handles one specific job. Let’s walk through them—no jargon, just common sense.
NS = Name Server. The NS record answers: "Who is in charge of this domain?"
Real-life example: Imagine a massive office building. The receptionist doesn't give you the files you need; they tell you which floor and which manager has them.
The Job: It tells the internet, "For anything related to aniketdey.in, go ask these specific servers."
A = Address. This is the most important one. It answers: "What is the actual GPS coordinate (IPv4) for this site?"
The Connection: aniketdey.in → 93.184.216.34
The Job: If your website loads, an A record is doing the heavy lifting. It connects the name to the physical server.
Think of this as the "A Record" for the modern world. IPv4 addresses (the old numbers) are running out, so we created IPv6.
A Record = Old school (IPv4)
AAAA Record = High-tech (IPv6)
Don't sweat this one—your browser usually picks the best one automatically.
CNAME = Canonical Name. This answers: "This name is just an alias—go look at the main name instead."
Example: You might have www.aniketdey.in and blog.aniketdey.in. Instead of giving them both IP addresses, you tell the www version: "Just do whatever the main aniketdey.in is doing."
Pro Tip: An A record points to a number (IP). A CNAME points to another name.
MX = Mail Exchange. This answers: "Where should I drop off the letters?"
The Logic: Often, your website lives on one server (like Vercel or Hostinger), but your emails live on another (like Gmail or Outlook).
The Job: MX records make sure that when someone emails you, it doesn't get "delivered" to your website code by mistake.
TXT = Text. These are essentially notes you leave for other services to read. They don't "do" anything for the visitor, but they prove ownership.
Real-life example: It's like showing your ID at a security desk.
The Job: When Google or GitHub asks, "Do you really own this domain?", you add a TXT record with a secret code to prove it.
When you visit www.aniketdey.in, a tiny "conversation" happens in milliseconds:
NS Record: "Who’s in charge here?" (Answer: Cloudflare/GoDaddy/etc.)
CNAME Record: "Is www a nickname?" (Answer: "Yes, look at the main domain.")
A Record: "Where is the main domain parked?" (Answer: "IP 93.184.xx.xx")
Browser: "Got it! Loading the site now." 🎉
If this feels like a lot to take in, that’s okay. Most developers look this up every single time they set up a new project.
Just remember:
DNS is the phonebook.
Records are the specific details.
Thanks for reading! If you found this guide helpful, feel free to check out my other projects or reach out via the links below:
🌐 Portfolio: aniketdey.in
💻 GitHub: github.com/AniketDey06
🐦 X (Twitter): x.com/AniketDey_