Skip to main content

Command Palette

Search for a command to run...

What happens when you search any web page

Updated
2 min read

When you first search any URL in the browser, the browser will check for its IP address in the cache if you have visited it before.

If you have never visited the website before and the IP address cannot be found, the browser asks the OS to locate the website. The first place the OS checks is the hosts file. If the address is not found there, the OS will make a DNS request to find the IP address of the webpage.

The first thing DNS does is ask the ISP’s DNS resolver to look up its own caches to see if the address is stored. If not, the resolver asks the root server, which then points it to the appropriate TLD(Top Level Domain) server (like .com, .org, .in etc.). The TLD server then directs it to the authoritative name server for that domain. The authoritative name server finally returns the IP address of the URL.

After the OS receives the IP address, it gives it to the browser, which makes a GET request to that IP address. When the request is made, the browser asks the OS again, which then packs the request into a TCP packet (or QUIC if using HTTP/3), and sends it to the IP address.

On its way, the request is checked both by the OS firewall and the server firewall to make sure there are no security violations. Upon receiving the request, the server responds to the browser along with its SSL certificate (in the case of HTTPS) to initiate a secure session.