What happens when you type google.com in your browser and press Enter

Tony Baidoo
5 min readApr 1, 2022
google.com being typed in a browser
google.com being typed in a browser

It’s one of the things no one really ever thinks about. Everyone simply gets on their browser, types a website name and presses enter, expecting a webpage to load up, which almost always happens (unless you have internet connectivity issues ). But what really goes on behind the scenes? what processes/steps are responsible for retrieving the requested web page? How is all this happening so quickly? In this article, I go under the hood and give you an overview of whats really happening. So let’s say we want to do some research, so we decide to go on google.com

1. Firstly, we type in google.com into the address bar of a browser of your choice and press enter

2. DNS Request and Lookup; finding the actual address of the website

At its most basic, DNS is a directory of names that match with numbers. The numbers, in this case are IP addresses, which computers use to communicate with each other. Think of DNS like your smartphone’s contact list, which matches people’s names with their phone numbers. DNS is like the phonebook of the internet. When enter is pressed, a request is sent to the DNS to find the website’s IP address. So in our case, a request to sent to the DNS Server to find the IP address of google.com. The website name is simply just a domain name/label, to actually retrieve google.com we need to know its address (in this case, not a phone number but an IP address) to get there, similar to the way if you wanted to reach out to your friend, you’d need their phone number to place a call. In a nutshell, DNS translates/matches domain names to IP addresses so browsers can load Internet resources. DNS servers eliminate the need for humans to memorize IP addresses such as 192.168.1.1 (in IPv4), or more complex newer alphanumeric IP addresses such as 2400:cb00:2048:1::c629:d7a2 (in IPv6).

3. The browser initiates a TCP/IP connection with the server.

Once the browser receives the correct IP address, it will build a connection with the server that matches the IP address to transfer information. Browsers use internet protocols to build such connections. TCP/IP stands for Transmission Control Protocol/Internet Protocol and is a suite of communication protocols used to interconnect network devices on the internet. TCP/IP specifies how data is exchanged over the internet by providing end-to-end communications that identify how it should be broken into packets, addressed, transmitted, routed and received at the destination.

4. Connection Established and Communication begins

After a TCP connection is established, the browser and the server can start communicating and sharing information with each other. The browser will send a GET request asking for google.com web page. This request will also contain additional information such as browser identification and types of requests that it will accept. This is done with Hyper Text Transfer Protocol (HTTP) or HTTPS, the protocol over which data is sent between your browser and the website that you are connected to. The issue with HTTP is that, it is not secure, the information being sent back and forth is not encrypted meaning information sent over can easily be intercepted.

Google uses HTTPS (Hyper Text Transfer Protocol Secure) which is the secure version of HTTP, With a HTTPS connection, all communications are securely encrypted. HTTPS pages typically use one of two secure protocols to encrypt communications — SSL (Secure Sockets Layer) or TLS (Transport Layer Security). Both the TLS and SSL protocols use an ‘asymmetric’ Public Key Infrastructure (PKI) system which involves the use of two ‘keys’ to encrypt communications, a ‘public’ key and a ‘private’ key. Anything encrypted with the public key can only be decrypted by the private key and vice-versa. SSL is responsible for providing authentication and encrypting sensitive information like card numbers, usernames and passwords. Web browsers such as Internet Explorer, Firefox and Chrome also display a padlock icon in the address bar to visually indicate that a HTTPS connection is in effect.

Firewall and Load balancer

A firewall is a security firmware or software that forms a barrier between networks to allow and block certain traffic. It inspects traffic so that it can block threats that might harm your systems. The HTTPS request is received on the firewall and let through, then HTTPS request is distributed to one of google’s web servers by the load balancer.

The Role of the Load Balancer: Modern high‑traffic websites like google.com must serve hundreds of thousands, if not millions, of concurrent requests from users or clients. They don’t have just one server, but tens of thousands of them to prevent overloading. The load balancer efficiently distributes incoming network traffic across a group of backend servers.

5. Server Response

The server contains a webserver (i.e. Nginx, Apache), which is used to serve either static or dynamic content, that receives the request from the browser on port 443 and passes it to a request handler to read and generate a response. The response contains the web page you requested. The web server first checks if the requested URL matches an existing file. If so, the web server sends the file content back to the browser. If not, an application server builds the necessary file. If neither process is possible, the web server returns an error message to the browser, most commonly 404 Not Found

A server can serve either static or dynamic content. In Static Websites, Web pages are returned by the server which are prebuilt source code files built using simple languages such as HTML, CSS, or JavaScript. There is no processing of content on the server (according to the user) in Static Websites. Web pages are returned by the server with no change.

The term dynamic means that the server processes the content or even generates it on the fly from a database. This approach provides more flexibility, google.com is a dynamic website. For example, when you do a google search on anything, it provides results based on your search words. The content changes based on your interaction with the website.

6. The browser displays the HTML content.

The response returns to the browser and the required webpage is rendered on screen.

Brief Diagram of the process:

--

--