How does the browser resolve DNS?
- 2 minutes read - 215 wordsHave you ever wondered how your browser resolves a domain name when you hit Enter on a URL? Here’s how it works, at a high level.
Your browser first looks in its own cache for the address. If it doesn’t find it, it checks the OS cache, and finally the ISP’s cache.
If the name isn’t cached, the next step is the
/etc/hostsfile. If there’s anIPaddress there, the browser tries to load the page from that server.If there’s no entry in the hosts file, the resolver reads
/etc/resolv.confto find anameserver. That nameserver will either have the answer cached, or it will use theroot hintsfile containing the IP addresses of theroot servers.You can run the
digcommand on its own to fetch theroot hintsfor your configured resolver.The root servers point to the
root zone, managed by IANA (the Internet Assigned Numbers Authority).The root zone database contains the top-level domains. For example,
.comis a top-level domain delegated to VeriSign - so those are nameservers operated by VeriSign.Those nameservers hold the records for the domain you’re trying to reach, and return its
IPaddress.
And with the IP address in hand, your browser can finally open a connection and request the page.
Share on: