What Happens When You Type ‘www.google.com’ In Your Web Browser, and Press ‘Enter’?

Daniel Dohou
10 min readApr 27, 2023

--

An Open Web Browser

You desperately need to clear a doubt, maybe you were in an argument with a friend, a loved one, or much more, and you need to confirm something that bothers you. Then you pick up a phone, or maybe a laptop, and open up a web browser (Chrome, for me preferably), and type in ‘www.google.com’. Then, you press the ‘Enter’ key, and voilà, it loads up like the picture you see below:

Typing ‘www.google.com’ into a web browser and pressing ‘Enter’.

Hi there 👋. I’m Daniel Dohou, a Software Engineering student on ALX SE Africa Cohort 18 (as of the time I’m editing this blog), and I’m also A Beautiful Mind 💮.

In this blog, I’ll explain what happens when you type in ‘www.google.com’ in your web browser, and press Enter.

Lifting the curtains, let’s see what goes on behind the scenes.

You open a tab in your web browser, type in ‘www.google.com’, and proceed to press the ‘Enter’ key.

But before proceeding, keep in mind that we call ‘www.google.com’ a Domain Name.

A Domain Name

A Domain Name is the unique address of a website on the internet. It’s a human-readable name that identifies a website or other resources on the internet.

Think of a Domain Name as your home address, but this time, it’s written legibly on paper. Now, we do not call that piece of paper your home, but following the address on that piece of paper leads you home. In our scenario, ‘www.google.com’ is the address, thus, the domain name, that leads you to Google’s search web page.

We now know that ‘www.google.com’ is our domain name. You type our domain name into your web browser, and press ‘Enter’. So…, what’s next? Let’s dive in…

After pressing Enter, the entered domain name is now changed to an IP Address.

An IP Address is a unique address that identifies a website or a device on the internet or a local network. It’s a string of numbers separated by periods.

An example of an IP Address is 192.158.1.38.

IP addresses form a very essential part of how the internet works. This is because they are unique identifiers, containing location information of web servers and computers on the internet, making them accessible for communication and interaction.

An example of an IP address

Of course, I heard your thought 🌚: ‘Why is our domain name converted to an IP address?🤷‍♂

Here’s why. Our domain name (‘www.google.com’) is converted into an IP address because computers communicate with each other over the internet through IP addresses. So, when you type in a domain name into your web browser, your computer searches the corresponding IP address to establish a connection to the correct device or website on the internet.

But here’s the thing:

Our domain name is changed to a IP address by a distributed database, called the Domain Name System (DNS).

This whole process of converting a domain name to an IP address is called the DNS Resolution or DNS Lookup Process. How does this work?

  • First, your device’s web browser sends a request to a Local DNS resolver (a server designed to receive DNS queries from web browsers, usually provided by the Internet Service Provider (ISP)).
  • Then, the Local DNS resolver first checks its cache (a storage area on your browser, that stores data for a short time) to see if you have a recent copy of the IP address for our domain name.
  • If there is a recent copy, your web browser uses the IP address stored in its cache to forward a request to the DNS server.
  • But, if the IP address of our domain is not found in any recent copy of the cache, the DNS resolver sends a DNS query to a DNS Name Server (also known as a TLD) to resolve our domain name into an IP address.

The TLD (an acronym for Top-Level-Domain) is a DNS name server that keeps all the information for all the domain names that share a common domain extension (and by ‘common domain extension’, we mean ‘.com’, ‘.net’, ‘.ng’, etc).

In our scenario, the .com TLD name server contains all the information and data related to all the .com domains.

  • Now, our browser checks if we’ve previously interacted with a .com domain, and responds to the local DNS resolver with the address of another server, called the Authoritative DNS name server, for the .com domain, all to get the needed info for our domain, ‘www.google.com’.
  • The local DNS server then receives the address of the Authoritative DNS Name Server from the .com top-level domain and then sends a request to the Authoritative DNS Name Server.

Talking about the Authoritative DNS Name Server, it’s a server that provides an updated mechanism that is used to manage a specific or public DNS name.

  • Now, the Authoritative DNS Name Server answers its DNS queries, translates our domain name into a corresponding IP address, and then returns this IP address to the local DNS resolver.
  • On getting the IP address from the Authoritative Name Server, the local DNS resolver sends the IP address back to our web browser.
  • Now that the IP address has been received, it’s stored in your web browser’s cache by the DNS resolver, for future visits or requests for the same domain name, translating to the received IP address.
  • Then, the browser sends a TCP/IP (IP — Internet Protocol) request to the server at the IP address.

The TCP stands for Transmission Control Protocol. It is a communication protocol that is used to establish a connection between two devices, between two websites, or between two servers over the internet. It provides a reliable, ordered, and error-checked delivery of data and information between devices and websites running on servers, and these devices and websites communicate with each other using their IP addresses.

  • The TCP/IP request is sent by our web browser, using the TCP connection, to the server at the IP address of our domain name (‘www.google.com’) for the web page it needs access to.
  • After the server at the IP address of our domain name receives our TCP/IP request, it sends back a copy of our web page files to our computer’s IP address so that we can view them in our web browser (This establishes a TCP/IP connection, between the server and our web browser).
  • But before these files are received by our web browser and before the TCP/IP connection is established, it passes through a system we call the Firewall.

A Firewall, also known as a Web Application Firewall, is a network security system that monitors and controls incoming and outgoing network traffic based on predefined security rules. It uses these rules to protect our computers and our network connections from unauthorized access and malicious cyber attacks. Every server has a firewall.

A sketch of how a firewall works.
  • Before the request is approved and a connection is established, the Google server (for our domain name) passes through our server firewall to make sure that each traffic of data being transferred from the server to our web browser is inspected using its security rules and free from external threats and malware. This means that if the incoming request meets all the security rules set by our firewall, our connection is established, and our web browser can now access the website.
  • After the TCP/IP connection is established, it is encrypted using HTTPS/SSL.
HTTP / HTTPS And SSL / TLS

The HTTPS (Secure Hyper Text Transfer Protocol) is the secure version of the HTTP (Hyper Text Transfer Protocol), and it encrypts the data that is being transmitted through an established TCP/IP connection between our web browser, and Google’s server.

Encryption protocols and algorithms are used to scramble and secure the data being shared over our connection, thereby making ourdata impossible to intercept by hackers, as it travels across our TCP/IP connection.

These protocols are known as the Secure Socket Layer (SSL) and Transport Layer Security (TLS).

Let’s get this straight with an example. You send a gift to someone, but you need only that person to access it. Then, you lock this gift in a rectangular box, that can only be opened by a unique code, that only that person has. HTTPS here is the locked rectangular box, containing our data. And the unique code that is required to open that box, is our SSL/TLS.

  • Now, our web page is sent to the web browser, and our encrypted HTTPS request passes through something called a Load Balancer.

A Load Balancer is a type of server that distributes incoming web traffic across multiple back-end servers using load-balancing algorithms.

A load balancer acts as the “traffic cop” sitting in front of your servers and routing client requests across all servers capable of fulfilling those requests in a manner that maximizes speed and capacity utilization and ensures that no one server is overworked, which could degrade performance. And if a single server goes down, the load balancer redirects traffic to the remaining online servers.

A Load Balancer
  • In our case, a load balancer would receive our incoming HTTPS request from our web browser, and then forward it to one of Google’s back-end servers. Then the load balancer chooses a server that it eventually sends our HTTPS request to. The load balancer selects this server using a load-balancing algorithm. The chosen server then receives our request and handles our HTTPS request.
  • After our load balancer chooses a Google backend server, it sends the HTTPS request to that server, and the server handles the HTTPS request using its three fundamental layers (the web server, the application server, and the database (you could make more research on this :))
  • Once our web server is done handling the HTTPS request, it sends a response to the browser containing all the web page resources and files.
  • On receiving the response, our web browser processes and renders the files of the web page in our web browser.

The rendering process is simply interpreting the HTML and CSS code, rendering any images or other media that are included on the page, and executing any JavaScript code that is present on the page.

  • Finally, we get to interact with our domain name: www.google.com, as it is now displayed in our browser 👇

In a picture, here’s a summary of everything we said so far:

Summary of what happens when you type in www.google.com in your web browser and press ’Enter’

Here’s a recap on the terms we defined:

1. Domain Name: A unique address of a website on the internet. It is a human-readable name that is used to identify a website or other resources on the internet.

2. IP Addresses: Unique Identifiers, containing location information of web servers and devices on the internet, making them accessible for communication and interaction. They form a very essential part of how the internet works.

3. IP: Internet Protocol.

4. DNS Resolution or DNS Lookup Process: The process of converting human-readable domain names to machine-readable IP addresses.

5. Local DNS Resolver: A server designed to receive DNS queries to web browsers, and the local DNS resolver is usually provided by the Internet Service Provider (ISP)).

6. DNS: Domain Name System

7. Cache: A high-speed storage layer on your browser, that stores frequently accessed data for a short time, making it readily available to the requesting application or users.

8. TLD (Top-Level-Domain): A DNS server that keeps all the information for all the domain names that share a common domain extension.

9. Authoritative DNS Name Server: A server that provides an updated mechanism that is used to manage a specific or public DNS name. This server answers its queries, translates our domain name into a corresponding IP address (so that the exchange of information between your web browser and the internet), and returns this name to the local DNS resolver.

10. TCP/IP: TCP stands for Transmission Control Protocol. It is a communication protocol that is used to establish a connection between two devices, between two websites or between two servers over the internet.

11. Firewall: Also known as a Web Application Firewall (WAF), it is a network security system that monitors and controls incoming and outgoing network traffic based on predefined security rules. These rules were established to protect our computer and our network connections from unauthorized access and malicious cyber attacks.

12. HTTPS (Secure Hyper Text Transfer Protocol): Being the secure version of the HTTP (Hyper Text Transfer Protocol), it is a protocol that encrypts the data being transmitted across an established TCP/IP connection.

13. Secure Socket Layer (SSL): An encryption protocol and algorithm that is used to scramble and secure transmitted data, thereby making data impossible to intercept by hackers, as data travels across the TCP/IP connection.

14. Load Balancer: A type of server that distributes incoming web traffic across multiple back-end servers using load balancing algorithms.

15. Web Server: A software application that stores and delivers web pages and other content to clients upon request.

16. Application Server: A software platform that provides an environment for running web applications. It typically includes a web server, but also provides additional features, such as database connectivity, security, etc. The application server may or may not interact directly with the database.

17. Difference between a web server and an application server:

→ A Web Server serves static content over the internet

→ An Application Server provides an environment for running dynamic web applications with additional features.

18. Database: A collection of organized data that can be easily accessed, managed, and updated. The purpose of a database is to store and organize data in a way that allows for efficient retrieval and manipulation of information.

19. Database Management Systems (DBMS): Specialized software applications that enable users to create, store, retrieve, manipulate, and manage databases.

That was a long read, but worth it! Drop a comment below, and tell me what you think. Do criticize my write-up too.

Feel free to connect with me on Twitter, GitHub, LinkedIn, and via Email too.

Thank you for reading 🙃

--

--

Daniel Dohou

Upcoming Software Engineer, and Aspiring Full Stack Developer. A Beautiful Mind 👨‍💻🎧🤍