What happens when you type in the Browser URL?
By: Alvaro Paçó
Tags: Network, Software, Internet, Interview

This is a recurrent question in hiring process interview. For example, at Amazon and Google interviews. Normally the engineering knows what happens behind the scenes but not in the other tip. I will try to answer this question briefly.

You enter a URL into a web browser The browser looks up the IP address for the domain name via DNS The browser sends a HTTP request to the server The server sends back a HTTP response The browser begins rendering the HTML The browser sends requests for additional objects embedded in HTML (images, css, JavaScript) and repeats steps 3–5. Once the page is loaded, the browser sends further async requests as needed.

As writted by Wil Vincent at https://wsvincent.com/what-happens-when-url/.

But what’s a DNS and how it works?

When a user wants to access a webpage, they enter the address (or DNS name) into their browser’s address bar. This information is then sent in the form of a ‘DNS query’ to their Internet Service Provider’s (ISP) DNS servers. Every ISP has a database of DNS names and their corresponding IP addresses. If a user’s initial query can be answered using this directory, an ‘authoritative’ answer is sent to the user’s computer so they can connect with the website.

If the ISP directory is unable to answer the initial DNS query authoritatively, then its next step would be to check its cache. A server’s cache holds a record of all other previous queries. If it can answer a user using information from the cache, then it will still answer but with a ‘non-authoritative’ answer. This means that the information you’re being supplied with isn’t directly from your ISP’s directory, but from a third party.

If your query still can’t be answered, then the DNS query process will use recursion. This is when your ISP’s DNS survey uses the information it has on other authoritative servers in its root hint files to contact and get the information you need. Once an ISP has requested this information, it is sent to a user’s computer, where a connection is formed. The ISP server then stores that information in its cache which can be then accessed for future queries.

Problems with Internet service are often down to an issue with the DNS server — to check any current issues with your DNS status, use our Service Status page.

And how about the ISP?

Every computer that is connected to the Internet is part of a network, even the one in your home. For example, you may use a modem and dial a local number to connect to an Internet Service Provider (ISP). At work, you may be part of a local area network (LAN), but you most likely still connect to the Internet using an ISP that your company has contracted with. When you connect to your ISP, you become part of their network. The ISP may then connect to a larger network and become part of their network. The Internet is simply a network of networks.

Most large communications companies have their own dedicated backbones connecting various regions. In each region, the company has a Point of Presence (POP). The POP is a place for local users to access the company’s network, often through a local phone number or dedicated line. The amazing thing here is that there is no overall controlling network. Instead, there are several high-level networks connecting to each other through Network Access Points or NAPs.

I hope you enjoyed it!