DEV Community

Mavvyy
Mavvyy

Posted on

# What Happens When You Type "https://www.google.com" in Your Browser: Understanding the Journey of a URL

Have you ever wondered what happens when you type a website address into your browser's address bar and press Enter, such as "https://www.google.com"? Although loading a web page may appear to be a straightforward process, it involves an intricate interplay of many different technologies and systems. We'll walk you through the processes involved in requesting a web page from the internet in this blog post.

DNS Resolution in Step 1

The moment you press Enter, the procedure starts. The browser must identify the IP address connected to the domain "www.google.com." This undertaking is completed by the DNS, or domain name system. This is how it goes:

  1. Check the local cache: If an IP address for the same domain has already been resolved, your browser looks in its local cache. If a match is made, it utilises that IP address rather than continuing with DNS.

  2. Operating System Verification: The browser sends the request to the operating system of your computer if the IP address is not present in the local cache. Additionally, the operating system checks the DNS cache for a cached IP address. If it does, it sends it back to the browser.

(3) DNS Resolution The operating system sends a DNS query to a DNS resolver if the IP address is still unable to be located. This resolver could be made available by a third-party service like Google's Public DNS or your ISP (Internet Service Provider).

Recursive DNS Query #4 A recursive search is done by the DNS resolver. To determine the authoritative name servers for the top-level domain (in this case, ".com"), it makes contact with the root DNS servers. After that, it makes a query to those reliable name servers to discover the IP address for "google.com."

Five. Caching Your operating system receives the IP address after the resolver locates it and caches it for later use.

Establishing a Connection in Step 2

The browser can now establish a connection to the web server hosting the webpage once it has the IP address in its possession. Utilising the Hypertext Transfer Protocol (HTTP) or HTTPS (HTTP Secure) is required for this.

Here is what transpires:

First, the HTTP/HTTPS handshake: A secure connection is made if the website employs HTTPS, which the majority of websites do for security. In order to secure encrypted communication, this involves a handshake.

  1. The TCP Handshake Your computer and the web server establish a Transmission Control Protocol (TCP) connection. Data transmission using this connection is dependable.

  2. Request Sent: The browser transmits an HTTP request to the web server, asking for a certain web page or resource (in this case, the Google homepage).

Server processing in Step 3

The web server now processes the request and gets ready to respond after receiving it. What takes place on the server side is as follows:

  1. Routing: Which online page or resource matches the URL you requested is decided by the web server. Secondly, Server-Side Processing: The server generates the HTML content when a web page is dynamic (e.g., when it is dependent on a database) by executing server-side scripts (e.g., PHP, Python, or Node.js) and making database queries.

Response Generation: 3. The web page's HTML is assembled on the server together with any additional resources it need for proper rendering, such as images, CSS, or JavaScript files.

  1. HTTP Response: The server then sends your browser an HTTP response including all of this information.

Rendering the Page in Step 4

The web server sends the HTTP response back to your browser. Following is how the browser interprets it:

  1. HTML Parsing: The browser starts by analysing the HTML code to create a Document Object Model (DOM) model of the structure of the web page.

(2) Rendering The browser gradually produces the page as the DOM is built, obtaining external resources like pictures and stylesheets as necessary.

  1. Execution of JavaScript: The browser runs JavaScript if it is present on the web page. JavaScript has the ability to dynamically change the page's behaviour and content.

Displaying: 4. Finally, your browser displays the complete rendered web page so you may interact with it.

Summary

Typing a site address and pressing Enter may seem like a straightforward move, but there are actually many different procedures and technologies involved. Each step is essential to providing the web information you requested, from DNS resolution to server processing and browser display. Understanding this procedure can help you better appreciate the complexity of the internet and the functions that each component performs.

Top comments (0)