How does my computer know how to get to a website? [ASK MR. NOOBIE]

Ask Mr. NoobieQUESTION: I want to ask you that if I am visiting any website then how the internal connections are made to the address I have given to it? – Monali from Nagpur, Maharashtra

ANSWER: If I understand your question correctly, you are asking me how a computer figures out when you type in a website address, like noobie.com, where to go to retrieve and display that website in your browser. If so, I could get into a bunch of technical detail but I thought it would be more fun to answer using an analogy.

Think of your website request like a destination on a long road trip across the country. Let’s say you want to go to Las Vegas and stay in the Paris Las Vegas hotel. If you looked up the Paris hotel by name in your GPS, it would check its database for a match and then lock in an actual street address, namely 3655 Las Vegas Blvd. South, Las Vegas, NV.

A website address like noobie.com has a physical address associated with it as well that tells you what server a website is located on. We techies refer to it as an IP address. You may have seen one before. An IP address is made up of 4 octets (a number between 0 and 255) separated by periods. The current IP address for noobie.com is 198.74.56.76.

DNS is GPS for computers

Your computer doesn’t have GPS but it does have an association to something called a Domain Name System (or Server), otherwise known as DNS. This is a database of domain names and their associated IP addresses. There are millions of these servers all across the world and updates made to one quickly propagate to the others in order to keep them all synchronized with the same information.

Now that your computer knows the IP address it wants to get to, it sends its request along your Internet connection. Servers along the way act as traffic cops to make sure your request takes the most efficient route to its destination. If things get a little clogged up one way, these servers can divert traffic to a different route to keep things moving along.

network scheme

This is like your GPS routing you to Las Vegas one major city at a time. When you reach each city, your GPS tells you the fastest route to the next city. And if a traffic jam backs things up on a major road, your GPS can detour you around the problem.

One address, multiple websites

There’s one last piece to the puzzle. The IP address for a domain only gets you to the server which could contain hundreds of different websites. It’s then the server’s job to make sure the website you want is really on that server and if so, grant you access to it. This is like finally arriving at the Paris Las Vegas Hotel and requesting a specific room number. All of the rooms at the hotel have the same street address but only one room in the hotel is the one you want.

When the destination is finally reached, the code needed to display the website is retrieved and sent all the way back to your computer (albeit not necessarily the way you came) so it can be displayed in your browser.

Each time you click on a link or otherwise request another page on a website, this entire process is repeated again. It’s pretty amazing when you think about it. All of this happens in the 2-3 seconds it takes a webpage to load. If only we could get to the Paris Las Vegas hotel and back that fast.

Do you have a question for Mr. Noobie®? Submit your question here.