DEV Community

Cover image for How Does The Internet Work? Part 1: Browsing a Website
Ahmed Abu Qahf
Ahmed Abu Qahf

Posted on • Updated on

How Does The Internet Work? Part 1: Browsing a Website

Who doesn't use the internet at least once during the day? Almost everyone, right? You start by opening up your browser (Firefox, chrome, safari...etc.), write down your favourite website's URL (DEV, Google...etc.) in the browser's address bar, you hit go and BOOM the website shows up, but have you ever considered how does this happen? what happens behind the scenes so once you gave the browser the website address, it shows up?

Understanding how the Internet works is very important. Lots of people usually skims through the surface of the concepts behind the working mechanism of the internet without fully understanding how everything works together. Without these foundations, it becomes very difficult to think about performance, optimizing sites and so on. Therefore, I decided to share with you what I know about that, and I decided to post it as a series so that the post won't take you too much time reading it.

Part 1: Browsing a Website

(A) Finding out The Domain's IP Address

Alt Text
When you enter a website URL (Google.com ...E.g.) in your browser URL bar and hit the go button, the browser first needs to know the IP address of this domain you want to visit in order to navigate to it. Therefore, the browser checks its cache which keeps DNS records for (2-30 minutes). If it is not there, the browser sends a request to your internet router asking it "Who is this Google.com fellow?" Your router does the same by checking its own cache for DNS records. If it is not there either, it sends the same request to your ISP asking the same question "Do you know this google.com?" Your ISP sends the same request one more time to its DNS cache. The DNS replies back to the ISP: "I don't know who google.com is but I have its address, here it is 127.217.7.23". The ISP returns the IP Address back to the router which in turn sends it back to your browser.

(B) Navigating to the Website

Alt Text
Once the browser receives the IP Address, it sends a HTTP request to that address asking for establishing a connection between the browser and the website's web servers. The Web servers handle the request, and reply back to the browser by sending the website's HTML, CSS and JavaScript which the browser renders so that you can view the website's page as it should be.

Cover Image Icon License: icons8 Free License.

Top comments (0)