DevelopmentEducationProgramming

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

22nd July, 2024 10 min read

Imagine the internet as a massive library, filled with endless shelves of books containing every piece of information you could ever need. Browsing this library could be overwhelming, but luckily, we have web browsers to help us find exactly what we’re looking for.

A web browser is like a smart librarian, knowing exactly where to find the information you want. For example, when you type something like “google.com” into your browser, it’s like asking the librarian for a specific book. But instead of using the easy-to-remember name “google.com,” computers use a different system to find things, called IP addresses — like the library’s catalog numbers.

This process of translating “google.com” into an IP address happens behind the scenes through a system called DNS (Domain Name System). It’s like the librarian looking up the book’s catalog number to find its exact location on the shelf.

In this article, we’ll explore how this all works. We’ll follow the journey from the moment you type a web address into your browser to the moment the webpage appears on your screen. You’ll learn about the roles of DNS requests, TCP/IP connections, firewalls, SSL encryption, load balancers, web servers, application servers, and databases. Each step is like a part of the library system, working together to bring you the information you need quickly and efficiently.

Domain Name System(DNS) Request

When you type “google.com” into your browser and press Enter, the first step in finding the right webpage is the DNS request. Think of it like this: you’ve asked your librarian for a book by its name, but to find the book, they need its catalog number.

Here’s what happens in simple terms:

  1. Checking the Cache: First, your browser checks its own memory (cache) to see if it already knows the IP address (catalog number) for “google.com”. If it finds it, great! The process is quick, and the browser can move on to the next step.
  2. Asking the Operating System: If the browser doesn’t find the IP address in its memory, it asks your computer’s operating system if it knows the address.
  3. Querying the DNS Resolver: If the operating system doesn’t have the answer, it asks a DNS resolver (usually provided by your internet service provider). This resolver is like a librarian who knows where to find the book’s catalog number.
  4. The DNS Resolver’s Job: The DNS resolver starts by checking its own cache. If the resolver doesn’t know the answer, it asks the root DNS servers, which direct it to the right place to find the catalog number.
  5. Finding the Authoritative DNS Server: The resolver eventually reaches the authoritative DNS server for “google.com”. This server has the correct IP address and gives it to the resolver.
  6. Returning the IP Address: The DNS resolver then passes the IP address back to your browser. Now your browser knows the exact “catalog number” (IP address) of the book (webpage) you’re looking for. With this information, it can move on to the next step to retrieve the actual content from the internet.

TCP/IP Connection

The TCP/IP connection is like the backbone of your communication with the website, making sure that your requests and the server’s responses are reliably and accurately exchanged. After your browser has the IP address for “google.com” from the DNS request, it’s time to connect to the server where the website lives. This connection happens using something called TCP/IP, which is like making a phone call to the server to start a conversation.

Here’s a simple breakdown of how it works:

  1. Starting the Connection: Your browser wants to talk to the server, so it uses the IP address to dial up the server. This process is called the TCP handshake and it happens in three quick steps:
    i. SYN: Your browser says, “Hello, can we talk?” (SYN).
    ii. SYN-ACK: The server responds, “Sure, we can talk. Are you ready?” (SYN-ACK).
    iii. ACK: Your browser replies, “Yes, I’m ready!” (ACK).
  2. Sending and Receiving Data: Now that the connection is open, your browser and the server can start exchanging data. This is like having a conversation over the phone where both sides can send and receive information.
  3. Reliable Communication: TCP ensures that all the data sent from your browser to the server (and back) arrives correctly and in order. If any part of the data gets lost, TCP makes sure it’s resent until everything is complete.
  4. Closing the Connection: Once your browser has finished loading the webpage, it politely says goodbye to the server and closes the connection. This is done to free up resources for other tasks. With this connection established, your browser can now start downloading the actual content of the webpage from the server.

Firewall

Just like when you get to the library, before you can enter, there’s a security guard at the door. This guard ensures that only people who are there to use the library properly can get in, and anyone causing trouble is kept out. The same thing happens with your computer and the server when you’re browsing the internet.

Here’s how firewalls work in simple terms:

  1. Your Computer’s Firewall: Before your request to visit “google.com” leaves your computer, it passes through a firewall. This is like the security guard checking you as you leave the library to make sure you’re not carrying anything harmful. If everything looks good, you can go.
  2. Server’s Firewall: When your request reaches Google’s servers, it goes through another firewall. This is like another security guard at the entrance of the server, checking to make sure your request is safe. If it’s safe, the request is allowed in.
  3. Filtering Traffic: Firewalls filter data based on rules, just like a guard would only let in people who follow the library’s rules. They ensure that only good, safe data gets through and block anything suspicious or harmful.
  4. Two-Way Protection: Firewalls work both ways. They make sure nothing harmful goes out from your computer and nothing harmful comes in from the internet. It’s like the library guard making sure you don’t take anything valuable out without permission and that nothing harmful is brought in.
  5. Keeping Systems Safe: By monitoring and controlling data, firewalls keep both your computer and the server safe from cyber threats, much like security guards protect the library and its users.
    So, firewalls are like the security guards at both ends of the internet connection, making sure everything that passes through is safe and secure. Once your request gets past these guards, it can reach the server to fetch the webpage you’re looking for

HTTPS/SSL

Imagine that after you’ve been checked by the security guard at the library’s entrance (the firewall), you want to have a private conversation with a librarian to get some important information. You don’t want anyone else to overhear your conversation. This is where HTTPS and SSL come in.

Here’s how it works in simple terms:

  1. Securing the Connection: When you type “https://google.com" into your browser, you’re asking for a secure connection. It’s like asking the librarian to speak with you in a private room where no one can listen in.
  2. SSL Handshake: Before the private conversation starts, there’s a process to ensure that both you and the librarian trust each other. This is called the SSL handshake.
    i. Hello and Agreement: Your browser and the server greet each other and agree on how to encrypt the conversation, so no one else can understand it.
    ii. Server’s Certificate: The server shows a certificate, like an ID card, proving it’s really Google and not an imposter. Your browser checks this ID with a trusted authority to make sure it’s valid.
  3. Encrypting the Data: Once trust is established, everything you communicate is encrypted. This means the information is turned into a secret code that only you and the server can understand. It’s like talking in a special language that only you and the librarian know.
  4. Secure Communication: Now, any data sent between your browser and the server is secure. If anyone tries to listen in, they won’t understand the coded messages. This keeps your information safe from eavesdroppers.

So, HTTPS/SSL is like having a private, secure conversation in the library, ensuring that no one can overhear or tamper with the information exchanged between you and the librarian. This secure connection allows your browser to safely request and receive the webpage you’re looking for. It’s especially important because it protects your personal data, like search queries and login details, from being intercepted or stolen by hackers.

Load Balancer

Continuing with our library illustration, let’s explain load balancers:
Imagine the library is very popular, and many people want to speak with the librarian at the same time. If everyone tries to talk to the same librarian, it would get crowded and slow down the service. To handle this, the library has multiple librarians, and a helpful assistant at the entrance who directs each visitor to the librarian who is available and has the least workload.

Here’s how a load balancer works in simple terms:

  1. Distributing Traffic: When you type “google.com” into your browser, the request reaches the server, but instead of one server handling all the requests, there are many servers ready to help. The load balancer is like the assistant at the library entrance, distributing the visitors (requests) evenly among all the available librarians (servers).
  2. Ensuring Availability: If one librarian (server) is busy or unavailable, the assistant (load balancer) directs you to another available librarian. This ensures that you get the information you need without delays.
  3. Handling More Visitors: By distributing the workload, the library can handle more visitors at the same time. Similarly, a load balancer helps websites manage more traffic efficiently by spreading the load across multiple servers.
  4. Improving Reliability: If one librarian (server) needs a break or encounters a problem, the assistant (load balancer) reroutes the visitors to other librarians. This improves the reliability of the service, ensuring that visitors (users) always get the help they need.

So, a load balancer is like the helpful assistant at the library, ensuring that visitors are efficiently directed to the available librarians, making sure everyone gets the information they need quickly and smoothly. This helps websites like Google handle millions of users at the same time without slowing down.

Web Server

Imagine the library has a special section where all the books are kept. When you ask for a specific book, the librarian retrieves it from this section and hands it to you. The web server works in a similar way. Once your request reaches the server, the web server is responsible for retrieving and delivering the webpage you asked for.

Here’s how it works:

  1. Receiving Requests: When you type “google.com” into your browser, the request goes to the web server. Think of the web server as the librarian who receives your request for a specific book.
  2. Handling Requests: The web server’s job is to find and provide the right “book” (webpage) you requested. It looks up the content and prepares it for you.
  3. Serving Content: Once the web server has found the content, it sends it back to your browser. This is like the librarian handing you the book you asked for.
  4. Static and Dynamic Content: A web server can handle both static content (like simple text or images) and dynamic content (like personalized search results). It’s like having a librarian who can provide not just physical books, but also custom-written notes or information based on your request.

So, a web server is like the librarian in the library, responsible for retrieving and delivering the right content when you request it. It ensures that your browser gets the webpage you asked for, whether it’s a simple static page or a more complex dynamic one.

Application Server

Imagine you want a special book that isn’t just on the shelf — it needs to be created or customized based on your request. For this, the library has a special room where librarians prepare these custom books or detailed reports.

Here’s how an application server works:

  1. Processing Requests: When you request something more complex, like specific search results or a customized report, the request goes to the application server. Think of it as the librarian in the special room who handles more detailed and personalized tasks.
  2. Running Applications: The application server runs the necessary programs or scripts to generate or process the content you need. It’s like the librarian using special tools to create or customize the book based on your request.
  3. Returning Results: Once the application server has processed your request and created the content, it sends it back to the web server. The web server then hands it to your browser.
  4. Dynamic Content: Unlike the web server, which handles static content, the application server deals with dynamic content — information that changes based on your interactions or inputs.

So, the application server is like the librarian in the special room, working behind the scenes to prepare customized or complex content based on your request. It ensures that you get the detailed and interactive elements of the webpage, which are then delivered to you through the web server.

Database

Imagine the library has a huge storage area filled with all kinds of information, books, and records. When you need detailed information, the librarian goes to this storage area to find what you’re looking for.

Here’s how a database works:

  1. Storing Information: The database is like this storage area in the library. It keeps all the information, such as books, records, and details that the website needs to function. This includes things like user data, search results, or inventory.
  2. Retrieving Information: When the application server needs specific information (like your search results or account details), it asks the database to fetch this data. It’s like the librarian going to the storage area to get the right book or record.
  3. Organizing Data: The database organizes information in a structured way so it can be quickly found and retrieved. It’s like having well-organized shelves and catalogs in the library, making it easy to locate any book or record.
  4. Updating and Adding Data: The database also handles updates and new information. If you add a new book to your library account or make a purchase, the database records these changes.

So, the database is like the library’s storage area, holding and organizing all the information needed to deliver detailed and accurate content. It works with the application server to make sure you get the correct and up-to-date information whenever you request it.

Build

better 

softwares with me

Let’s turn bold ideas into delightful, user-friendly software that people truly love to use.

temfoden@gmail.com

Let’s work together

Got a question or proposal, or just want to say hello? Go ahead.

© 2025 Temitayo Afolabi. All rights reserved