DEV Community

Christina Sharon S
Christina Sharon S

Posted on

What is DNS and DNS Resolver?

Whenever a website like www.google.com is opened, the system needs to find its IP address.This is where DNS and the DNS resolver come into play.

What is DNS?

DNS stands for Domain Name System.

It works like the phonebook of the internet, converting easy-to-remember domain names into IP addresses which would be a very huge burden to remember(imagine the no. of 32 bit addresses we would have to remember).

For example:

  • Instead of remembering 142.250.183.14 we use google.com
  • DNS converts this name into the correct IP address

Without DNS, users would have to remember numerical IP addresses for every website.

What is a DNS Resolver?

A DNS resolver is the component that actually finds the IP address.

It acts as a middleman between the user and DNS servers.
When a domain name is entered, the resolver searches for the correct IP address and returns it to the system.

How It Works?

When a website is entered in the browser, the following happens:

  • The system first checks cache (browser and RAM)
  • If not found, the request is sent to the DNS resolver
  • The resolver starts searching step by step:
    • Contacts the Root server
    • Then the TLD server (like .com)
    • Then the Authoritative server(Zone Files)
  • The authoritative server returns the IP address
  • The resolver sends the IP back to the system
  • The browser connects to the server using that IP

Final Flow:

User -> Cache -> DNS Resolver -> Root -> TLD -> Authoritative -> IP -> User -> Server

Top comments (0)