What Is DNS? Why It's Important?

What Is DNS? Why It's Important?

Decoding How Your Browser Finds Websites

Β·

5 min read

Hello learners!

Ever wondered how your browser finds the website that you search for? How does your browser knows where exactly is www.google.com ? At least for once, you would have thought about these question. This is where DNS (Domain Name System) comes into picture.

This article will give answers to the above questions in an easier to understand manner. After reading this article you would become aware of how DNS powers your browser to look up for websites. So let’s dive into it!


DNS β†’ The PhoneBook Of Internet World πŸ“’

Yes, DNS is exactly the phonebook of the internet world. After you search www.google.com in your browser, it goes to DNS and looks to which IP address the domain name is pointing to and maps the domain name to IP address.

Analogy β†’ You came across a phone number which you did not know. You opened your phone directory and checked to which person this phone number belongs. This is what is DNS.


Underlying Mechanism of DNS βš™οΈ

Actually, it looks pretty simple on the face but there is a lot that goes on behind the scenes when DNS looks for the IP address corresponding to the searched domain name. That too is not difficult to understand.

Browser Demands The IP Address πŸ—ΊοΈ

Suppose, you are searching for www.google.com β†’ Your browser asks the DNS, "Where is www.google.com?”

But before asking the DNS, it first looks in the cache memory of the browser. If it is there then there are no further steps involved & browser gets the required IP address.

The Detective Comes In πŸ•΅πŸ»β€β™‚οΈ

If the IP address is not present in cache memory of the browser then the browser asks a detective (DNS Resolver) to find the IP address. This is where DNS starts to come in picture. This DNS Resolver first goes to a ROOT Server to help him finding the IP address.

Role Of The Root Server 🌲

Root solver helps in finding the server where the ending part of the domain name is present.

Ending part β†’ .com in www.google.com is the ending part of the domain. There can be various ending parts. For example, .com .in .org etc. Root Server gives the location of the server handling these ending parts.

TLD Server Comes Into The Picture ⏿

The server which is in-charge of all the domain names ending with .com is TLD (Top Level Domain) Server.

Similarly, other servers in-charge of other ending parts (.in .org etc.) are also called TLD Servers.

Analogy β†’ Root Server said to the detective β†’ β€œI don’t know where www.google.com is located, but I can tell you a person who knows where the people having .com as their surnames live!”

Authoritative Server Comes Into The Picture 🏠

After the Root Server tells the detective about the TLD Server. The detective goes to the TLD Server.

The detective asks the TLD Server β†’ β€œSomeone told me you know about domain names which end with .com can you tell me the address of www.google.com?” TLD Server answered β†’ β€œOk, I will tell you the authoritative server where www.google.com lives.”

Hence, Authoritative Server is that server where the IP Addresses of domain names are present.

Detective Returns To The Browser βœ…

After meeting the Authoritative Server, the detective (DNS Resolver) comes back to the browser and gives it the IP Address of www.google.com

Picture taken from Cloudflare Official Website https://www.cloudflare.com/en-in/learning/dns/what-is-dns/


Different Records In DNS πŸ“š

Records are used in DNS to store various types of information about the websites.

  1. A Record (Address Record) πŸ“

    This record contains the IP Address corresponding to the Domain Name.

  2. C-Name Record (Canonical Name Record) πŸ”©

    This record is used to tell what other subdomains also point to the ip address of main domain. For example β†’ aws.amazon.com can be a subdomain of the main domain amazon.com Benefit of using this record is that you don’t have to manually update the A Record entries for all the subdomains. Another benefit is that β†’ if you had manually added the IP address in the A Records of all the subdomains, then if the IP address of the main domain changes you will have to update manually the A records of all the subdomains as well because they were also pointing to the same record. C-Name Record takes care of this and you only have to update the IP address of main domain only.

  3. MX Record (Mail Exchange Record) βœ‰οΈ

    This record tells at what place the emails sent to the domain should go. For example β†’ You want that the emails sent to example@amazon.com should go to the mail server at the location mail.amazon.com So you will write mail.amazon.com in the MX Record.

  4. TXT Record (Text Record) πŸ’¬

    This record contains some additional data in text format. For example β†’ It can contain the domain name which the IP address points to.


Conclusion πŸ’―

This article tells exactly the capabilities of a DNS & how it powers the browser. Without the DNS, you can not even imagine if you would be able to access different websites. This article is enough to understand how the DNS works behind the scenes how it goes from Root server to TLD server to Authoritative server. Thank you for reading till this point. Follow for more such articles.

Β