What happens when you type google.com in your browser and press Enter
Published: 2022-12-20 18:15:59

---
title: What happens when you type google.com in your browser and press Enter
published: true
date: 2022-10-08 08:32:55 UTC
tags: 
canonical_url: https://mudina.hashnode.dev/what-happens-when-you-type-googlecom-in-your-browser-and-press-enter
---

![images.jfif](https://cdn.hashnode.com/res/hashnode/image/upload/v1665217502727/Bj0WoBAmc.jfif)

As a beginner, you've probably always wondered how the internet functions whenever you enter a URL. We would examine the infrastructure part of a web and how it functions in this article.

Before I begin, let me clarify three # concepts that will be important throughout this article:

## **- Servers**

A server is a computer program or equipment that offers a service to another computer program and its user, referred to collectively as the client. The physical machine that a server program runs on is sometimes referred to as a server in a data center. That machine could be a dedicated server or it could be utilized for anything else. Servers are frequently classified based on their intended use. The word "server(s)" shall be used in this article to refer to the computer system(s) that host www.google.com.

## **- Client**

A client is a computer or program that, as part of its operation, sends a request to another program, computer hardware, or software that accesses a service provided by a server (which may or may not be located on another computer). Online browsers, for example, are clients that connect to web servers and retrieve web pages for display.

## **- Protocol**

A protocol is a collection of rules or processes used in computer science to convey data between electronic devices such as computers. To transmit information between computers, there must first be an agreement on how the information will be organized and how each side will send and receive it. OSI (Open Systems Interconnection), a collection of standards for implementing networking communications between computers, is the most essential computer protocol. TCP/IP (Transmission Control Protocol/Internet Protocol), HTTPS (Secure HyperText Transmission Protocol), SMTP (Simple Mail Transfer Protocol), and DNS are some of the most essential Internet protocols (Domain Name System).

![1_YqxwjFvieYMhBSZQTL8vbw.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1665156799670/4CAY3xuaf.png)

# Additional technical terms that will be utilized in this article:

- DNS Request

- FireWall

- HTTPS/SSL

- Load Balancer

- Web / Application Server

- Database Server

- Google Server

- TLS

- Internet

## **DNS Request** 

A DNS query, often referred to as a DNS request, is a request for data sent from a user's computer to a DNS server by a DNS client. A DNS request is often performed to obtain the IP address linked to a domain name.

## **FireWall**

A firewall is a network security device that monitors and filters incoming and outgoing network traffic depending on previously set security policies in an organization. Firewalls protect traffic at a computer's entrance point, known as ports, where data is exchanged with external devices.

## **HTTPS / SSL**

The standard technology for keeping an internet connection secure and protecting any sensitive data that is being sent between two systems is called SSL, or Secure Sockets Layer. This technology stops criminals from reading and altering any information transferred, including potentially personal details. When a website is protected by an SSL certificate, HTTPS (Hyper Text Transfer Protocol Secure) is displayed in the URL. By clicking on the lock icon on the browser bar, you can read the certificate's details, including the issuing authority and the corporate name of the website owner.

## **Load Balancer**

Load balancing, commonly referred to as server farming or server pools, is the process of efficiently dispersing incoming network traffic among a collection of backend servers. The sole point of contact for clients is a load balancer.

## **Web / Application Server**

A web server accepts and processes client requests for static material (such as HTML pages, files, pictures, and videos) from a website. A software framework that transforms data to provide the particular functionality provided by a business, service, or application is known as an application server. Application servers improve the interactive sections of a website, which might change depending on the context of the request.

## **Database Server**

Any server that runs a network database program and manages database files, such as Microsoft SQL Server or Oracle, is referred to as a database server. SQL Server is a powerful database management solution.

## **Google Server**

Google Web Server (GWS) is the proprietary web server software used by Google for its web infrastructure.

## **TLS**

Transport Layer Security (TLS) is a cryptographic technology developed to offer network communications security.

## **Internet**

Internet is a worldwide computer network that provides a variety of information and communication services and is made up of interconnected networks that use standardized communication protocols

Now that we've defined these terms, what happens when you type google.com into your browser and hit Enter?

![OIP (2).jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1665171308145/6yCawW5no.jpg)

## **To get the IP address for google.com, the browser searches its cache for a DNS record** 

Your browser needs to determine which Internet server to connect to when you type the URL into it and hit Enter. In order to accomplish that, it must see the DNS server on your corporate network or at your ISP, it does a recursive DNS lookup if the browser is unable to locate the IP address at any of those cache layers. Recursive DNS lookups search through several DNS servers on the Internet, which then query other DNS servers until the desired DNS record is located.

The browser must now locate the server on the Internet and create a connection after receiving the DNS record with the IP address of the server that is home to the website you entered. Between your browser and numerous locations around the Internet, there are various layers where DNS data is cached. Your browser checks its cache, the operating system cache, a local network cache at your router, and a DNS server cache on your company's network or at your ISP (ISP). If the browser is unable to locate the IP address at any of those cache layers, your ISP's or corporate network's DNS server performs a recursive DNS lookup.

## **The browser will then establish a TCP connection with the server.**

The browser connects to the server using TCP after acquiring the IP address. Packets from a client browser request are routed through the router, the ISP, and an internet exchange to transfer ISPs or networks, all while utilizing transmission control protocol (TCP) to discover the server with the IP address to connect to at port 443. After the browser connects to the server, a Secure Socket Layer (SSL) certificate is generated to indicate that the domain is secure. The next step is to make an HTTP request to obtain the resource or page.

## **HTTP requests are sent to the server by the browser.**

Now that the browser is connected to the server, it follows the HTTP(s) protocol's communication rules. It begins with the browser sending an HTTP request to the server in order to obtain the page's contents. The HTTP request includes a request line, headers (or request metadata), and a content. The request line provides information that the server can utilize to determine what the client (your browser in this example) wants to perform. Google.com gets the request, utilizes the passed information (cookies) to determine who the user is, location, language, and region, and sends http redirects (HTTP GET 302) to the browser to use the local regional Google server, i.e. google.com. in this case.

## **Client receives response from server after processing request.**

The server accepts the request and determines how to handle it depending on the data in the request line, headers, and body. The requested content is retrieved from the accessible database.

The following is included in the answer:

- A status line that informs the client of the request-response status and response headers that instruct the browser how to treat the response to the resource being requested at that path, which may be content like HTML, CSS, Javascript, or picture files, or data.

- Static files, both text (HTML files) and non-text data, are examples of resources (images). But static files aren't usually requested by browsers. There is frequently no file attached to these resources because they are frequently dynamic resources created at the moment of the request. After then, the content is rendered by the browser.

## **The manner in which the browser renders content**

The browser layout engine will begin to construct the final page for display. CSS and JS information may change the page's layout. When the browser receives the server's answer, it examines the response headers for information on how to present the resource. The Content-Type header above informs the browser that an HTML resource was received in the response body.

There is sometimes a high volume of client queries to servers (you are typing google.com, other people are typing so much more). A load balancer is used to improve server efficiency and reduce loading time. The final page is put together and displayed to the user. Following that, the browser may send more AJAX requests to connect with the web server even after the page has been rendered.

![1_rQQQnm2lnUA99L6HM6flKA.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1665173034531/ubjPrgbPk.png)

# **Conclusion**

Although this appears to be a long and tiresome procedure, we know that a web page renders in less than a second after we push enter on our keyboard. All of these phases occur in milliseconds before we are even aware of them. That is the power of the internet.

Thank you for reading!