What Happens When You Type 'google.com' in Your Browser

Web Developer 🌐
Have you ever been curious about how your browser precisely knows what to display when you enter a web address or URL? When you type something like "google.com" and press Enter, your browser embarks on a journey to find the IP address linked to this domain, enabling it to load the webpage. In this article, I will explain the step-by-step process of how the browser obtains the IP address.
First, the browser checks it's local cached memory, this is a storage where previously accessed web pages are stored for a specific amount of time. if you have visited "google.com" recently and it's still in the browser's cached memory, the browser can retrieve the page from the cache accelerating the process.
if the page is no longer in the browser's cached memory, the browser then proceeds to check the Operating System's cache as the Operating System retains recent records of DNS (Domain Name System) lookups. The Domain Name System (DNS) is the phonebook of the Internet. When users type domain names such as ‘google.com’ into web browsers, DNS is responsible for finding the correct IP address for those sites. If the domain "google.com" appears in this record and the data is still up-to-date, the IP address can be obtained without initiating a fresh DNS inquiry.
Should the IP address not be found in the Operating System cache, the request is forwarded to the DNS servers of your Internet Service Provider (ISP). An ISP is a company or organization that provides internet access and related services to individuals, businesses, and other entities. Examples of ISPs are MTN, GLO, AT&T, etc. ISPs manage these servers to aid in the conversion of domain names into corresponding IP addresses. They maintain a cache of their own, facilitating faster responses in case the requested domain information is already stored.
If the IP address for a specific domain is not present in the cache of the ISP, the ISP's DNS server takes the next step by reaching out to the authoritative DNS servers overseeing the Top-Level Domain (TLD) associated with the domain in question. The Top-Level Domain is the last segment of a domain name in a web address, representing the highest level in the hierarchical domain naming system. The TLD is part of the domain name located to the right of the last dot, typically following the second-level domain (SLD) which is the website's name. In this scenario, the TLD is ".com." The authoritative DNS server designated for ".com" holds crucial and detailed information about the domain "google.com," including the exact IP address linked to it. This process ensures accurate and up-to-date IP resolution for the requested domain.
Once the IP address is acquired, the browser initiates a TCP (Transmission Control Protocol) connection with the server associated with that IP address to facilitate communication. While a UDP (User Datagram Protocol) connection is an option, it's unnecessary in this situation since real-time data isn't essential.
Once a TCP connection is established, the browser sends an HTTP request to the server to perform a specific action—like fetching website data or updating server information. In the case of typing a URL, the browser initiates a GET HTTP request to obtain the website content.
Upon receipt of the request, the server processes the task as requested and transmits back an HTTP response to the browser. In this response, the server includes the webpage, such as text, images, and videos. The browser then displays the HTML content, presenting it in a readable format for users to see.
It is important to note that these processes happen very quickly, often going unnoticed due to their speed.
Reference:
https://www.cloudflare.com/learning/dns/what-is-a-dns-server/



