When you typing something on the browser, have you ever wondering whether the site you are looking for locate? And how the browser able to search and response the page to your computer? Let’s find out in this article.
What is browser rendering?
A page resources content HTML, CSS and Javascript and web browser will take these resource and visualize into our screen. This involves several stages, including parsing, constructing internal representations, and painting pixels on the screen.
DNS navigation
Before a browser can render a webpage, it must locate the server where the website is hosted. This involves translating the human-readable domain name into an IP address called Domain Name System (DNS) resolution.
The process to transfer from hostname into a system-readable IP involve following steps:
- User enters the domain name in the browser.
- Computer requests DNS lookup from the DNS resolver (recursive resolver).
- DNS resolver checks cached data for the IP address.
- If cached, the resolver returns the IP address to the browser.
- If not cached, the resolver queries the root DNS server.
- Root DNS server responds with the address of the TLD nameserver (e.g., .com TLD nameserver for example.com).
- Resolver queries the TLD nameserver.
- TLD nameserver responds with the address of the domain’s authoritative nameserver (e.g., example.com’s authoritative server).
- Resolver queries the authoritative nameserver.
- Authoritative nameserver responds with the IP address of the host.
- Resolver caches the IP and returns it to the browser.
- Browser requests resources directly from the host using the IP.
Caching mechanism
Image your site is located on different country that far far away from your location and so he DNS lookup could take sometime to finally complete the request for the resource. Because of that, caching is critical so that it browser can speed up the process of rendering page. This include storing previous DNS result temporarily on your machine.
Today you are learned about the DNS look up, in the next article we will discuss how resources from web page are visualized into your screen. Stay tune!
