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

Designed by Bello Ibrahim


This question is a classic and still widely used interview question for many types of software engineering positions. It is used to assess a candidate’s general knowledge of how the web stack works on top of the internet.

So, in this article, I will cover the working process of:

  • DNS request
  • TCP/IP
  • Firewall
  • HTTPS/SSL
  • Load-balancer
  • Web server
  • Application server and
  • Database

So, what exactly happens when you type in www.google.com (or any other website) on your web browser address bar (URL) and hit the enter key?

?

Firstly, I would like us to understand that google.com is a domain name or any other website. This domain name is human-readable (easy-to-remember) and needs to be translated into numeric IP Addresses that are used by computers to identify each other on the network. This is where DNS comes into play.

?

Before I jump into DNS, let me talk about Internet Service Providers (ISPs). What happens behind the scenes(your browser and the ISP)?

So, let's assume you're sitting at home on your computer or elsewhere and you type in www.google.com because you want to head over to the main Google home page.

?

Well, what happens behind the scenes is that your browser will send that message to your ISP or your Internet Service Provider. So these are the people who you pay to be able to access the Internet.

Now the message that you're sending the ISP is “I want to see google.com” and the ISP will then relay that message to something called a DNS server, which stands for a Domain Name System server.

?

What happens when you make that request through your browser is the DNS server will look up in its database to find the exact IP address of the website that you're trying to access. And every single computer that's connected to the Internet has an IP address.

?

It's kind of like a postal code for your computer so that when people need to send and receive files on the Internet, each computer can be located and contacted using its unique IP address.

?

And once the DNS server finds that IP address, it will send it back to your browser through the ISP, over the internet.


Then you can make a direct request to that address. And what lives at that IP address is of course the Google servers, and they'll be able to send you back all the files and data you need to be able to view the Google home page.

So, what is Domain Name System? is a decentralized hierarchical system that translates human-readable domain names into numerical IP addresses. Computers on the internet communicate with each other using IP addresses, which are numerical labels assigned to each device on a network. DNS acts as a kind of phone book for the internet, allowing users to access websites and services using easy-to-remember domain names instead of memorizing IP addresses.

A DNS request is a query made by the client computer or device to a Domain Name System (DNS) server to obtain the IP address associated with a specific domain name. When you enter a web address (e.g., www.google.com) into your browser's address bar and press Enter, your device needs to determine the IP address of the corresponding server to establish a connection. DNS requests can be in two forms; Forward lookup or Reverse Lookup.

?

In forward lookup, when you type in a domain name in your browser address bar it is translated into an IP address associated with the domain name while in reverse lookup, when you type in an IP address in your browser address bar, a domain name is returned. Learn more on How DNS works and DNSimple?

Initiating a Transfer Control Protocol (TCP/IP) Connection

When DNS resolution is resolved successfully, this allows your browser to know where to send the request by initiating a TCP connection to the server hosting google.com.? A TCP/IP (Transmission Control Protocol/ Internet Protocol) governs how data between two different devices are transmitted over the communication channel. With the use of the TCP/IP model, we can transfer files, images, text, and email from one computer to another.? This is the beginning of the communication channel between your computer and Google’s servers – why servers? …I will explain in more detail.??

Firewall

This is a network security that monitors and controls incoming and outgoing network traffic based on predetermined security rules. The Outbound traffic from your computer is subject to firewall rules. If the firewall permits the outbound connection to the IP address associated with "google.com," the request proceeds. If not, the firewall may block the connection, preventing access to the website.

HTTPS /SSL

HTTPS stands for (Hyper Text Transfer Protocol Secure) why SSL (Secure Socket Layer). After establishing the connection over a secured layer, your browser sends an HTTP request to the Google server, asking for the homepage or other information. The SSL ensures the confidentiality and integrity of data transmitted between the user's web browser and a website's server. When you see "HTTPS" in a website's URL (e.g., https://www.google.com), it means that the website is using either SSL or TLS to secure the communication between your browser and the server.

Load Balancer

I mentioned Google’s servers earlier, right? First of all, what is a load balancer?

A load balancer is a device or software application that efficiently distributes incoming network traffic or workload across multiple servers. In another definition, It is a method of distributing network traffic equally across a pool of resources that support an application. The primary purpose of a load balancer is to ensure that no single server bears too much load, preventing performance bottlenecks and improving the overall reliability and availability of applications or websites.

?

Google service is the most widely used search engine in the world, have you ever wondered why it serves pages or been able to load pages as fast when you make a request simultaneously and return the correct text, videos, images, and other data in a fast and reliable manner? This is the work of a load balancer, is evenly distributes incoming network requests (such as HTTP requests for a web server) across multiple servers. This helps in optimizing resource utilization and preventing any single server from becoming overwhelmed.? Other characteristics of the load balancer are Scalability, High Availability, Health monitoring, Session Persistence, SSL Termination, etc.

?

Web Server and Application Server

These servers are two distinct components in the architecture of web applications. They have different roles and responsibilities, and they often work together to deliver dynamic and interactive web content.

The Web server handles HTTP requests from clients (typically web browsers) and serves static content to users. Static content includes files like HTML, CSS, images, and client-side scripts.

Examples of a web server are: Nginx, Apache HTTP Server, Microsoft Internet Information Services (IIS)

While

Application Server is responsible for executing the business logic of an application, processing dynamic content, and generating responses based on user input.

The application server is responsible in:

  • Executing server-side code (e.g., PHP, Java, Python, etc) to process data and generate dynamic content.
  • Communicate with databases to retrieve or update information.
  • Manage application state and user sessions.

Examples of an application server are Microsoft ASP.NET, Apache Tomcat, Node.js, Django, etc.

In summary, Web servers and application servers often work together in a complementary manner to deliver complete web applications.

?

Database

This is a structured collection of data that is organized and stored in a way that allows for efficient retrieval, management, and updating of information. Databases play a critical role in various applications and information systems, providing a systematic and centralized approach to data storage.

The relationship between a database and an application server is integral to the development and functioning of dynamic web applications. These two components work together to store, retrieve, and manipulate data, enabling applications to provide dynamic and interactive content to users.

?

I hope this article has been insightful and helpful in understanding a little bit of how the internet works.

With ?? Bello Ibrahim

要查看或添加评论,请登录

Bello Ibrahim的更多文章

社区洞察

其他会员也浏览了