What Happens When You Type https://www.google.com
Tags: google, alx
Published: 2024-05-05 21:14:37

In today's digital age, browsing the internet has become an integral part of our lives. When we type in a URL like **"https://www.google.com"** and hit Enter, several steps take place behind the scenes to load the desired web page. Let's take a closer look at what happens when you type "https://www.google.com" into your web browser.

![https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s8dcmd4w0hj0uxtvsmqs.png](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s8dcmd4w0hj0uxtvsmqs.png)

1. The first step is to convert the domain name "www.google.com" into an IP address. This conversion process is called DNS resolution. The DNS resolution process begins by checking the local DNS cache on your computer or router to see if the IP address for the domain name is already stored there. If the IP address is not found in the local DNS cache, the next step is for your computer or router to send a DNS query to a DNS server. This DNS query is typically sent to the DNS server provided by your Internet Service Provider. The DNS server then checks its own cache to see if it has the IP address for the domain name. If the DNS server does not have the IP address in its cache, it will recursively query other DNS servers until it finds a DNS server that can provide the IP address for "www.google.com".

2. Once the IP address for "www.google.com" is obtained through DNS resolution, the next step is to establish a TCP connection with the web server hosting the google.com website. This TCP connection is established using the IP address and a specific port number, usually port 443 for HTTPS connections. 

3. Once the TCP connection is established, a secure SSL/TLS handshake takes place between the web browser and the web server. During this handshake, the web browser verifies the authenticity of the web server's SSL/TLS certificate to ensure a secure connection. 

4. Once the SSL/TLS handshake is completed and the secure connection is established, the web browser sends an HTTP request to the web server for the specific resource or webpage - in this case, the homepage of Google.

![https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kf2c39gm0qq6q8952z36.png](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kf2c39gm0qq6q8952z36.png)

5. The web server receives the HTTP request and processes it. The web server retrieves the requested resource or webpage, in this case, the homepage of Google.

6. The web server then constructs an HTTP response containing the requested resource or webpage, and sends it back to the web browser over the established TCP connection.

7. The web browser receives the HTTP response from the web server and starts rendering the webpage. In the rendering process, the web browser parses the HTML markup of the webpage and constructs a Document Object Model representation of the webpage. The rendering process involves applying CSS styles to the HTML elements, executing any JavaScript code present on the page, and displaying the visual representation of the webpage to the user. The web browser then displays the rendered webpage to the user, which includes text, images, and interactive elements. 

In summary, the process of accessing a website involves DNS resolution, establishing a TCP connection with the web server, performing an SSL/TLS handshake for secure communication, sending an HTTP request to the web server, receiving and processing the HTTP response, and finally rendering the webpage in the web browser for display to the user.