When You Type "google.com" into Your Browser and Press Enter, This Happens!

When You Type "google.com" into Your Browser and Press Enter, This Happens!

When you open your browser (Chrome, Safari, Opera, etc.), type google.com and press enter, a lot happens under the hood. Any time you do this, or at least occasionally, you might have wondered what happens immediately after you press the enter key.

Although it is just a few seconds before you get the list of search results, a lot happens. For those who believe in magic, it all seems like magic because a complex chain of events takes place in milliseconds, yielding useful research that millions of people seek every day.

I will demystify this in this blog. I delve into the details so that you can have a clear picture the next time you search for anything. In the end, after learning how the web works, you will appreciate its beauty.

But just before we start, a browser is an application you use to access the web, in this case, Edge, Chrome, Safari, Firefox, Opera, etc.

With that out of the way, let us dive in.

What Happens when you type “google.com” and press the Enter Key?

You have probably heard techies or come across concepts such as DNS requests, TCP/IP, firewalls, HTTPS/SSL, load balancers, web servers, application servers, and databases. They seem like buzzwords, but by the time you are done with this article, you will be knowledgeable enough to put each into its context in matters of the internet and how it works.

Before we dismantle everything, the short answer to this question is: When you type "google.com" and press enter, your browser first performs a DNS lookup to find the IP address associated with the domain. Then, it establishes a TCP connection with the Google server. Next, it sends an HTTP request to the server, requesting the homepage content. The server processes this request, generating the necessary HTML, CSS, and JavaScript. Finally, your browser receives this response, renders the webpage, and displays the Google homepage. This seamless process, involving DNS resolution, server communication, and client-side rendering, allows you to access the vast resources of the internet with just a few keystrokes.

Let us now look at each of these processes and piece together the puzzle.

DNS Request

When you type “google.com” into your browser, the first step your browser initiates is a DNS (Domain Name System) lookup. Here, your browser needs to translate the human-readable domain name “google.com” into a corresponding IP (Internet Protocol) address.

Since computers do not understand human language, the DNS translates the domain name you type into the browser into an IP address. This way, the computer can establish a connection with the respective server that hosts the domain you’ve requested.

An IP address is a numerical label assigned to each device connected to a computer network. A DNS server facilitates the translation, acting as the internet’s equivalent of a phone book, mapping the domain names to their respective IP addresses.

The computer mainly checks the local DNS cache, which stores the recently resolved domain names and their addresses. So, if Google.com is in the cache, your computer aborts the rest of the DNS resolution process, saving time and resources. If the IP address is not in the cache, the computer sends a fresh DNS request to the DNS server.

Think of the DNS request as a gateway into the web.

TCP/IP Connection

With the resolved IP address of the domain, in this case, “google.com,” your browser initiates a TCP (Transmission Control Protocol” connection to the web server that hosts the domain’s website (in our case, Google website).

TCP/IP is a robust communication protocol that guards data integrity and ensures its reliability during transmission via a network. It is a set of rules that govern how the data is transmitted and received across the internet. Think of it as the foundation of Internet communication.

The connection is a virtual pathway through which data flows between the client (your computer) and the server.

Under the hood., when your computer and the web server want to communicate over the internet, they initiate a TCP connection, which involves a 3-way handshake to ensure that both devices agree to connect:

  • The client (your computer) sends a SYN or synchronized packet to the server.

  • The server responds with a “SYN-ACK” (synchronize-acknowledge) packet.

  • The client acknowledges the ACK packet.

TCP also manages the flow of data between client and server to prevent data overload through congestion control mechanisms. Once the data exchange is complete, the client and server terminate the connection via a 4-way handshake that involves:

  • The client sends a “FIN” packet to the server.

  • The server acknowledges with an “ACK” packet.

  • The server sends its “FIN” packet.

  • The client acknowledges the server’s “FIN” packet with an “ACK” packet.

The IP handles routing and addressing the data packets across networks. The data is split into small packets for transmission. Every packet has a tag of the source and destination address so that routers can efficiently determine where to send the respective packets. The routers use the destination IP addresses to determine the best path for each packet to its destination. The IP routers make forwarding decisions based on routing tables. Large packets are fragmented into smaller packets for transmission and reassembled by the recipient.

Firewall

Before establishing any connection with the server, in this case, the Google server, your computer might encounter a firewall. The firewall is the digital gatekeeper that monitors incoming and outgoing traffic for security threats. It filters legitimate requests and blocks any malicious or suspicious traffic. The firewall can be a software application or a physical device (hardware) that inspects and manages the flow of network traffic based on predefined security protocols.

The firewall assesses the incoming traffic from the client to Google’s server and only allows it if it is cleared for any threats.

HTTPS/SSL

Websites like Google use HTTPS (Hypertext Transfer Protocol Secure), a secure version of HTTP used to transmit data on the Internet. It encrypts data transmitted between the client and server.

SSL (Secure Sockets Layer) and TLS (Transport Layer Security) are encryption protocols used to secure data transmitted over HTTPS.

Once the browser establishes a connection with Google’s server using HTTPS, the browser and the server agree on the SSL/TLS version to use and create a secure encrypted channel for transmitting data. They also exchange cryptographic keys. The process is such that each party understands and decodes the data being transmitted.

The data transmitted between the server and browser is thus encrypted. So, even if someone intercepts the data in transit, they cannot access it unless they have the decryption keys.

SSL/TLS also ensures data integrity, limiting the chance of data being altered during transit without detection.

Each time you visit a website that has a valid SSL certificate, you can be sure that you are connecting to a secure, reliable, and trustworthy website and not an imposter.

Load Balancer

Google has a vast and distributed infrastructure spread across multiple servers, and it receives billions of website visitors in a day. Load balancers enable the connections by efficiently distributing the user requests among the network of servers to ensure that no server is overwhelmed with requests, maintaining optimal website performance.

A load balancer is a hardware (network device) or software application that acts as an intermediary between the client devices and the backend servers. A load balancer distributes the incoming network traffic across multiple servers, enhances scalability as it handles various levels of networks, and improves the availability of resources by continuous monitoring. Load balancers minimize downtime, ensure servers are healthy, and improve service reliability.

Web Server

A web server refers to a computer program responsible for handling requests for web pages from clients (in this case, your browser trying to access google.com).

When a client sends a request for a webpage to a web server, the server processes the request and returns a response to the client.

In our case, Google’s web server receives a request from the load balancer. The web server processes the request and generates a response constituting HTML, CSS, and JavaScript files that make up the specific webpage.

The response is sent back to the load balancer, which forwards it to the browser. The browser then renders the page using HTML, CSS, and JavaScript.

Application Server

In addition to static web pages, websites often contain dynamic content, such as search results on Google.

Application servers, such as those running on Node.js, Ruby, or Python, handle dynamic requests, query databases, and generalize personalized content.

Database

Under the hood, Google relies on massive databases to store and retrieve information quickly and reliably.

A database refers to a collection of data, and a Database Management System (DBMS) is the program that interacts with the database to perform CRUD operations such as retrieving, adding, modifying, and deleting data.

When you search for anything, the application server queries the databases to fetch the most valid and relevant search results, which are presented in your browser.

Before You Go …

If you came to this end, you are now more aware of everything that happens the few seconds when you type “google.com” on the search bar of your browser and press enter. This happens virtually every time you search for a domain online. The process is seamless, thanks to the hardware, software, and protocols (rules) that guide the connection and exchange of data. In just a simple search, there is an intricate interaction of DNS, TCP/IP, firewalls, HTTPS/SSL, load balancers, web servers, application servers, and databases that make it all happen from the comfort of your phone’s or your computer’s web browser.

Well, that’s a wrap; keep browsing and do it confidently now that you know the bells and whistles!