A brief Look into DNS Servers
Hello Everyone,
In today's fast-paced world, we interact with various web applications daily—whether it's using a cloud IDE like Replit, working with ready-made components from ShadCn, or exploring countless other tools. But have you ever wondered what happens under the hood of these web applications, especially concerning Domain Names?
In this article, we will dive into something called DNS Servers, which are an integral part of the Internet.
What is a DNS Server?
Let’s first understand what DNS is. Don’t worry—I won’t bombard you with jargon. I’ll keep it simple!
DNS stands for Domain Name System. It helps resolve domain names into their actual IP addresses. But what does that really mean? Let's use an analogy to explain.
An Analogy for DNS
Imagine you are my friend living in Massachusetts, US, and Christmas is approaching. I want to send you a Christmas gift, but to do so, I need your full address—your street name, apartment number, zip code, etc. Simply knowing that you live in Massachusetts wouldn't be enough, right? Without the exact address, my gift wouldn’t reach you.
Similarly, DNS works to help you find the "exact address" of websites you visit. The domain names (like google.com or facebook.com) are easy to remember for us humans. However, computers communicate using IP addresses. DNS resolves the domain names to the specific IP address for each site.
How to Find the IP Address of a Domain
You can actually check a website's IP address using your computer's terminal. Here's how:
On Windows: Open CMD.
On Mac/Linux: Open Terminal.
Type the following command:
nslookup google.com
You’ll see an output similar to this:
This shows the IP address behind google.com. If you were to enter this IP into your browser, you'd reach the Google homepage. This is exactly what DNS does—it resolves the domain name to its corresponding IP address.
High Level Design of the DNS:
Let’s break down the DNS process, step by step:
Root Name Servers:
When you type google.com into your browser and hit Enter, your request travels through the internet to one of the 13 Root Name Servers. These servers form the backbone of the DNS system, holding a large database of domain names and their corresponding IP addresses, along with some cached data.
Once your request reaches the root server, it directs the query to the TLD (Top-Level Domain) Servers.
TLD Name Servers:
You may be wondering: what exactly are TLD Servers?
TLD stands for Top-Level Domain. Examples of TLDs include .com, .org, .net, etc. For instance:
For google.com, the TLD is .com.
For cambridge.org, the TLD is .org.
Each TLD has its own set of TLD Servers, which store information about domain names with that particular TLD and the Authoritative Name Servers for those domains.
Authoritative Name Servers:
Finally, we reach the Authoritative Name Servers. These servers hold the definitive IP addresses for domains, provided by the registrar (the company where you purchased the domain). Popular authoritative name servers include:
Google Domains
Cloudflare
GoDaddy
Once your DNS query reaches this server, it provides the final answer: the IP address of the domain you’re trying to reach.
Conclusion
And that's a high-level overview of how DNS Servers work! Congratulations 🎉 —you’ve just learned how a DNS server works in just 5 Minutes.