DEV Community

Mohith
Mohith

Posted on

how DNS resolver is happening - CA27

actual my thoght process for the how DNS resolver is happening Every time you type something like google.com in your browser, your device has one simple goal — find the IP address of that website so it can connect to the server. This whole process is called DNS resolution, and even though it sounds complicated, it actually happens in milliseconds behind the scenes.

It starts from your device (the client). Before asking anyone else, your system first checks locally. That means it looks into the browser cache, operating system cache, and sometimes even the hosts file to see if the IP address is already known. If it finds it, then it can directly use it and skip the rest. If not, it sends a request to a DNS resolver, which is usually provided by your ISP or a public DNS service.

Now the resolver does the main work. It doesn’t directly know the IP address, so it starts asking step by step. First, it contacts a root name server. The root server doesn’t give the IP, but it tells where to find the TLD server (like .com, .org, .net). Then the resolver asks the TLD server. The TLD server responds with the address of the authoritative DNS server for that domain. Finally, the resolver queries the authoritative server, and this server returns the actual IP address of the website.

Once the resolver gets the IP address, it sends it back to your device and also stores it in cache so next time it’s faster. Now your browser finally has the IP address. Using that, it creates a connection (TCP/IP) and sends an HTTP request to the server to get the website content.

Top comments (0)