What Happens When You Type https://www.google.com in Your Browser and Press Enter?
Ever wondered what happens in the background when you enter a URL in your browser, hit the Enter button, and immediately get a response? Well, I bet you don't, hitherto, care about that but let me take you down the not-so-technical process that happens under the hood.
So, when you type "https://www.google.com" into your web browser and hit enter, your computer sends a request for the website's content to a server. The server then retrieves the content and sends it back to your computer, where it is displayed on your web browser. These happen rather very quickly, often within a few milliseconds.
However, there are many steps and technologies involved in this process, including networking protocols, HTTP, web servers, etc., that work together to bring the website to the user's screen.
Internet Protocol
Computers communicate with each other through the use of IP addresses, which stand for Internet Protocol address. An IP address is a numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. These addresses are used to identify and locate devices on the network and allow them to communicate with each other and exchange data.
IP addresses are often difficult for humans to remember. To make it easier for humans to access websites and other resources on the Internet, we use a string of characters called uniform resource locators (URLs) that specifies the location of a resource on the Internet.
For example, when you type "https://www.google.com" into your web browser and hit enter, your computer needs to determine the IP address of the Google servers where the website is hosted. This process is called domain name resolution, and it is what allows you to access websites using easy-to-remember domain names, rather than having to remember the IP addresses of each website.
DNS Resolution
When you enter "https://www.google.com" into your web browser, it first checks its cache for the IP address associated with the URL. If it doesn't find it, it sends a request to the operating system to resolve the IP address. If the operating system can't resolve it, it sends a request to the ISP's DNS servers. If they can't resolve it, they send a request to the root DNS servers, which either resolve the IP address or return an error message indicating that the domain could not be found. If the IP address is resolved, it is sent back to the ISP's DNS servers, then to the operating system, and finally back to the browser, which can use it to request the webpage from the server associated with that IP address.
The Firewall and SSL
The firewall is responsible for scanning incoming requests and determining whether they should be allowed or denied. It is crucial to protect the server from potential threats and malicious activity. By monitoring and filtering incoming requests, the firewall helps to ensure that only legitimate traffic is allowed to reach the server, thereby safeguarding the server from potential attacks or unauthorized access.
Recommended by LinkedIn
The request is sent using HTTPS over port 443, which is a secure communication protocol. The HTTPS protocol uses SSL/TLS encryption to secure the data exchange between the client and the server. This encryption is established through a process called the "handshake," in which the client and server agree on a shared encryption method. Once the encryption has been established, data can be transferred securely between the client and server using TCP.
The Web Servers
When the request is sent to a server, it is typically received by a load balancer and distributed to a web server. The web server may pass the request to an application server, which retrieves data from a database, processes it, and sends the results back to the web server. The web server generates a response and sends it back to the client's web browser.
The Eventual Response Display
This response is typically in the form of HTML (Hypertext Markup Language) code, which is a set of instructions for how the webpage should be displayed. The web browser's rendering engine then takes this HTML code and converts it into a visual representation of the webpage, which is displayed to the client.
Summary of What Happens When You Type a URL in Your Browser and Hit Enter
1. Computer sends a request to DNS to resolve the domain name to the IP address
2. Request is sent using HTTPS protocol over port 443 for secure data transfer
3. Server's firewall checks the request and it is distributed to the web server by the load balancer
4. Web server may pass requests to an application server to retrieve and process data
5. Web server generates a response in HTML code and sends it back to the client's browser
6. Browser's rendering engine converts HTML code into a visual representation of the webpage that is displayed to the user
When next you open your browser, type a URL and press the enter button, you better appreciate the work put together to seemlessly serve your request.