DEV Community

Sri Mahalakshmi
Sri Mahalakshmi

Posted on

How DNS resolver is happening

The user makes a request, and a DNS query starts. First, it goes to the local machine resolver, where the system checks the cache (browser/OS). If the IP is already present, it returns immediately.

If not found, the request goes through the internet (ISP) to the main resolver, usually the ISP or a public DNS. This resolver again checks its cache. If it has the IP, it returns it. If not, it starts the DNS lookup process.

The resolver contacts the root server. The root server does not know the exact IP, but it knows where the TLD servers are, so it directs the resolver to the correct TLD (like .com, .org).

Then the resolver asks the TLD server, which tells where the authoritative server for that domain is.

Next, the resolver asks the authoritative server, which gives the final IP address.

This IP is sent back to the resolver, then to the user’s system, and stored in cache for future use. Finally, the browser uses this IP to load the website.

https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hokmjfkufa9cwc7fe2a7.jpg

Top comments (0)