What Really Happens When You Type a URL Address in Your Browser…

Halina V
Halina V
Aug 9, 2017 · 3 min read
Internet of things

Most of the people using internet these days have no idea what is going on “behind the scenes” when they type in the ULR address. A lot of them think that internet is something like a cloud that stores all the .com and other domain names.

Let’s demystify this.

When you open your browser window and type in holbertonschool.com, first your browser will validate if the characters entered as a domain name are valid. The URL address should consist of letters, numbers, ‘-’ or ‘.’

The browser searches the cache for the DNS (Domain Name System) record associated with the URL name, if it is found, then the IP address associated with holbertonschool.com will be requested.

There are a few places that has cache stored and where the browser can find a DNS record:

  • browser cache
  • OS cache
  • router cache
  • ISP (Internet Service Provider) cache

If no records are found in the cache, the DNS server then sends a request to the root name servers and attempts to find an IP address associated with holbertonschool.com . If found — we have an IP address — otherwise the error message will be returned.

After IP address is found (YAY!)

Now our browser needs to establish a connection with the server that hosts the IP address. These connections are regulated by “rules” or protocols. One of the most common is TCP/IP (Transmission Control Protocol/Internet Protocol).

The server hosting the IP address will inspect our browser and our connection and approve or not (depending on firewall settings) to engage in data transmission. Firewalls which are part of the server may reject to serve us content because they are not open to incoming traffic, they don’t like our IP address, or… well, other reasons.

After our browser has established a connection with the server, now the server can provide data to us.

Almost.

After establishing the connection, the browser sends a HTTP request to the server.

So what’s happening on the server side?

When the server receives a request from the browser, it approves it and allows access through the firewall, then analyzes if the SSL certificate is needed.

If an SSL request was sent, then the server provides browser with the “key” to “unlock,” or decrypt, information that it will be serving to the browser in the encrypted from.

Let’s say the browser and server exchanged this info — now the browser request may encounter a load-balancer on the server side. Load-balancers are there to regulate volumes of incoming requests for the IP address and may redirect a browser request to different web servers if needed.

Next the browser’s request for the website is directed to the web server.

The web server then turns to the codebase and pulls up all the code that is associated with the website we requested. If special information was requested from the database, the server will then turn to the database to find the matching request. There are two types of code that can be served back to the browser — static and dynamic. Static code (HTML, CSS) can be interpreted by browser itself and don’t need any more actions from the server side. However if the website includes dynamic code (PHP, Java, Ruby), it first needs to be “translated” into understandable to browser form. And that is a job for the application server. This server will “compile” code and send it back to the browser in the HTML format.

After all data associated with the browser’s request was collected, the server then sends out the information to browser (in forms of packages), and our browser will present to us the contents of holbertonschool.com

Just like this:

Isn’t it amazing that it only takes a second (or a little more — depending on your internet speed) for your browser to show you the URL page you’ve requested, yet there are so many things going on behind the scenes with this task.


If you have any comments, feel free to connect.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade