Published on Mar 27 2022
Last updated on Apr 23 2024
Thanks to Domain Name System (DNS), users around the globe can access the internet easier without the need to remember the long IP addresses of their favorite websites.
For a browser on a computer to go to a website, it needs an IP address of the server where the website lives on. Those IP addresses generally look like this:
142.251.33.110
(IPv4) or 2607:f8b0:4004:813::200e
(IPv6)
It probably doesn't look familiar but you use those addresses almost every day. Those are the IP addresses of google.com and I can't remember that and neither can you (probably). In fact, the average person can only remember about 7 digits in their working memory at any given time! So, how can anyone remember any IP address?
To solve this problem, the Domain Name System translates a domain name to an IP address. So now anyone can go to google.com without memorizing its IP address.
In short, when you put in a URL or a domain name in the browser, your browser make a DNS query. Once your browser able to find the corresponding IP, it will use that address to retrieve the data of the websites (files and content). Below is the complete picture illustrated by Julia Evan (She is my favorite blogger/software developer).
Let's take a deeper look into the concept of a DNS query. When you type in a web address into your browser, it will attempt to do the following steps:
The browser will first look into the cached IP addresses inside your computer (a.k.a the recursive resolver or their local memory). If you're visiting a website that you've been to recently, this is where the query stops.
If your browser doesn't recognize the domain name, which means there is no matching IP address to that domain name in the local memory, the resolver will ask an authoritative nameserver.
Now, if the first nameserver you ask does know, then the DNS query is complete. However, if the root nameserver does not know, it will tell the resolver to go ask another authoritative nameserver, and the cycle goes on until the resolver finds the matching IP address.
The amazing part about DNS query is that this whole process happens extremely quick, in a split second, the browser is able to query, locate, and deliver a website to your eyes!
To summarize, DNS is the system that maps URLs with their IP address. DNS allows people to look up websites using human-friendly and easy to remember names. Without DNS, we would have to look through a phonebook contains long strings of IP addresses whenever we want to visit a website. Yay DNS!
Written by Alissa Nguyen
FollowAlissa Nguyen is a software engineer with main focus is on building better software with latest technologies and frameworks such as Remix, React, and TailwindCSS. She is currently working on some side projects, exploring her hobbies, and living with her two kitties.
Learn more about me
If you found this article helpful.
You will love these ones as well.
Built and designed by Alissa Nguyen a.k.a Tam Nguyen.
Copyright © 2024 All Rights Reserved.