Explained: What Happens When You Type 'www.google.com' in Your Browser and Hit Enter.
Adebayo Bamijoko
Solving problems in the SME sector through accessibility to affordable technology.
In the vast digital landscape of the internet, we often take for granted the simple act of typing a website address into our browser and being magically transported to our desired destination. Have you ever wondered what goes on behind the scenes when you enter "www.google.com" and hit that enter key? In this post, I will bring the magic that takes place to your imagination?and demystify the journey from when you "hit the enter button" to when the website gets displayed on your browser using the world's most popular search engine as an example.
The URL Structure:
Let's start with the fundamental building block: the URL, or Uniform Resource Locator (I'm assuming you are not a tech person or have no idea whatsoever on the topic).
The URL "www.google.com" consists of three parts:
a. Protocol: In this case, "https://" or "https://" (the secure version).
b. Domain: The main address, "google.com."
c. Subdomain: In this example, "www" serves as a subdomain.
HTTP: Stands for Hypertext Transfer Protocol, and it is the foundation for data communication on the World Wide Web. It allows for the retrieval and display of webpages and other resources. HTTPS is the secured version. used in addind an additional layer of security. This protocol is used when secure transmission of sensitive data is required, such as during online transactions or when submitting personal information on a website.
Domain: This is the specific address of the website being requested. There are no two websites with the same address. it serves as the human-readable version of the IP (internet protocol) address.
Subdomain: An optional part that appears before the domain name. It helps to further categorize and organize websites within a domain. In the example "www.google.com," "www" is the subdomain.
"www" represent that this is the main website of google.com. some websites can have subdomains such as shop.example.com, help.example.com, etc to further segment the domain.
Now that you understand the URL structure, let's walk you through the steps in detail.
1. DNS Resolution:
Once you hit enter, the browser first needs to find the IP address associated with "www.google.com." This process is called Domain Name System (DNS) resolution. The browser sends a request to a DNS server to obtain the IP address for the domain. Before then, the browser first checks its local cache, a form of memory, where previously visited addresses are stored (over a limited period of time) for future use.
For windows operating systems, the most common path is C:\Windows\System32\dns\cache while On macOS, the DNS cache is maintained by the "mDNSResponder" service. The cache is stored in a memory-mapped database file, and there is no direct access to the cache folder as in Windows. On mobile devices, it can be stored on the device OS, browser, and Application.
If the IP Address is not found in the local cache, the browser queries the operating system's configured DNS server or a DNS resolver.
2. DNS Resolver and Recursive Queries:
The DNS resolver receives the request from the browser and performs a recursive query to find the IP address associated with the domain. The resolver starts by contacting the root DNS servers, which hold information about the top-level domains like .com, .net, etc.
The root domain is the highest level in the hierarchical domain naming system. It is represented by a single dot (.) and serves as the starting point for the entire domain name structure. It doesn't have a specific name itself but serves as the foundation for all domain names. Every domain name originates from the root domain.
3.TLD Server Lookup:
The root DNS server responds to the resolver's query by providing the IP address of the appropriate Top-Level Domain (TLD) server for the requested domain, which in this case would be the .com TLD server.
A top-level domain is the segment that appears immediately to the right of the root domain in a domain name. It represents the highest level of organization in the domain name system. TLDs are commonly used to categorize and classify websites based on their purpose, type, or geographic location. Examples of TLDs include .com, .org, .net, .gov, .edu, and country-specific TLDs like .ng, .uk, .ca, or .sa.
4: Authoritative DNS Server:
The TLD server then directs the resolver to the authoritative DNS server responsible for the requested domain, which is "google.com" in this case.
The authoritative DNS server is responsible for maintaining and providing the authoritative DNS records for the domain it is authoritative for. These DNS records include information such as the IP address(es) associated with the domain, mail server addresses (MX records), name server addresses (NS records), and other DNS resource records specific to the domain.
examples of authoritative DNS servers are BIND, Microsoft DNS servers, Cloudflare DNS, Power DNS etc.
5: IP Address Retrieval and Establishing Connection:
The authoritative DNS server holds the IP address for "www.google.com" and returns it to the resolver. The resolver caches this information to expedite future requests.
This is where load balancers come into play. Load balancers are networking devices or software components that distribute incoming network traffic across multiple servers in a balanced manner.
In the case of a high-traffic website like Google, load balancers ensure that incoming requests are distributed evenly among multiple servers, preventing any single server from becoming overwhelmed.
With the IP address in hand, the browser can now establish a connection with the server selected by the load balancer to host Google's website. It does so by initiating a Transmission Control Protocol (TCP) handshake.
The TCP handshake ensures that both the client and server are ready to establish a reliable and bidirectional connection before data transmission begins. It helps verify that both ends are actively listening and can exchange data in a coordinated manner.
6. Sending the HTTP Request:
Once the connection is established, the browser sends an HTTP (or HTTPS) request to the server, specifying the specific webpage or resource it wants to access.
7. Server Processing, Response, and Data Transmission:
The server receives the request, processes it, and generates an appropriate response. In the case of "www.google.com," the server sends the response back to the browser, containing the requested webpage or resource, along with any associated data like HTML, CSS, JavaScript, database, and images.
8. Browser Rendering:
The browser receives the response and begins rendering the webpage based on the received data. It interprets the HTML markup, applies styles using CSS, and executes any embedded JavaScript to enhance interactivity.
Conclusion:
Next time you enter "www.google.com" or any other URL (www.example.com) into your browser, you'll have a better understanding of the intricate journey that takes place behind the scenes. From DNS resolution to establishing connections, a complex series of steps occur to bring you the desired webpage. Understanding this process can foster a deeper appreciation for the remarkable technology that powers our everyday web browsing experience.
? 2023 Adebayo.
Digital Media & Tech. Entrepreneur.