What happens when you type "google.com" in your browser
This used to be a popular interview question (at least a while back) to test a candidate’s understanding of the system. In this post, I will take a stab at going over this in simple terms.
As an analogy - lets consider what one would do if they have to visit a restaurant.
Find the address of the restaurant (by asking a friend, looking up from an advertisement and so on).
Make a route from their current location to the restaurant and travel.
Once you reach the restaurant, if they are open you would get in.
After you get in, check-in with their front house and get a table for your party.
Get seated, view the menu, order and enjoy the food.
Now lets map these steps in computer science terms.
You type “google.com” in your browser address bar and press enter.
Just like how a restaurant has a physical address, websites also have a digital address called IP Address. Your browser will try to find the IP Address of “google.com”.
Your browser will make use of Domain Name System (DNS) to find the IP address. DNS is simply a table of website (domain) to IP address. Eg.,
google =>64.233.177.100.You might wonder - is the DNS table stored within my device?
DNS content doesn’t live in your device. Think of DNS as another website. IP Address of DNS is well-known and stored within your browser. Your browser will make a request to DNS asking for a particular website’s IP address. DNS will respond with the IP address.
Similar to how you would find a physical route to the restaurant and travel, your browser will create a digital route to the IP address and send data.
Internally this will involve your device (eg., laptop) finding the network path from your device to the IP address.
There can be multiple devices involved in the path. Think of them as multiple roads that you would need to take to get to the restaurant.
Similar to how you would check if the restaurant is open and get in. Once the digital route is secured, your browser will try to establish a connection in order to make the communication happen.
Think of a network connection as a dedicated tunnel or a pipe between your device and the IP address. This will be used for back and forth communication.
It is possible that you go to the restaurant’s address and see that the restaurant is not in that location. May be it is a bad address or the restaurant no longer operates in that address. A similar situation can happen digitally as well and in this case you cannot find any device with the IP address.
It is also possible that the restaurant is present in the address but they are closed. This will be a case where you find the network path to the IP address, but the device doesn’t respond or rejects the connection.
You reach the restaurant and it is open. Then you would check-in with the front house. Similarly, once the network connection is established - you would send your request to view “google.com”.
The request will contain details about what you are looking for. It might be as simple as - I want to see “google.com”.
The device behind the IP address (lets call it server), will process that request and compose a response. Each response might be unique depending on your request. Eg.,
If your IP address is from India - you would get a doodle designed for India along with other supported regional languages.
If your device is a mobile device, then you would get mobile friendly content.
The final step in the restaurant example is that you get seated and view the menu. Here “google.com” sends back the web-page content to the browser and your browser will display them to you. Hurray!
Response will be in the form of code (html, javascript, css) that your browser will understand.
Browser will then display the content and wait for your next actions.
I hope that this post helps remember the concept better. Please note that the description is an abstracted version and each step here has a lot of internal details within it.


Good one. Do you think it will be useful to explain
1. How did your browser know DNS server address?
2. What is HTTP and where/when is it used