What happens when you type google.com in your browser and press Enter

What happens when you type google.com in your browser and press Enter

1. You type maps.google.com into the address bar of your browser.

2. The browser checks the cache for a DNS record to find the corresponding IP address of maps.google.com.

DNS(Domain Name System) is a database that maintains the name of the website (URL) and the particular IP address it links to. Every single URL on the internet has a unique IP address assigned to it. The IP address belongs to the computer which hosts the server of the website we are requesting to access. For example,?www.google.com?has an IP address of 209.85.227.104. So if you’d like, you can reach?www.google.com?by typing?https://209.85.227.104?on your browser. DNS is a list of URLs, and their IP addresses, like how a phone book is a list of names and their corresponding phone numbers.

The primary purpose of DNS is human-friendly navigation. You can easily access a website by typing the correct IP address for it on your browser, but imagine having to remember different sets of numbers for all the sites we regularly access? Therefore, it is easier to remember the name of the website using a URL and let DNS do the work for us by mapping it to the correct IP.

To find the DNS record, the browser checks four caches.

● First, it checks the browser cache. The browser maintains a repository of DNS records for a fixed duration for websites you have previously visited. So, it is the first place to run a DNS query.

● Second, the browser checks the OS cache. If it is not in the browser cache, the browser will make a system call (i.e.,?gethostname?on Windows) to your underlying computer OS to fetch the record since the OS also maintains a cache of DNS records.

● Third, it checks the router cache. If it’s not on your computer, the browser will communicate with the router that maintains its’ own cache of DNS records.

● Fourth, it checks the ISP cache. If all steps fail, the browser will move on to the ISP. Your ISP maintains its’ own DNS server, which includes a cache of DNS records, which the browser would check with the last hope of finding your requested URL.


要查看或添加评论,请登录

Alejandro Reginensi的更多文章

  • Internet of Things

    Internet of Things

    DefinitionWhat is the internet of things (IoT)? The internet of things, or IoT, is a system of interrelated computing…

  • Recursion: A Picture is Worth 1,500 Words

    Recursion: A Picture is Worth 1,500 Words

    What is Recursion? The process in which a function calls itself directly or indirectly is called recursion and the…

  • Class and instance attributes in Python

    Class and instance attributes in Python

    What’s a class attribute? Class Attributes are unique to each class. Each instance of the class will have this…

  • What are the differences between static and dynamic libraries?

    What are the differences between static and dynamic libraries?

    Why using libraries in general? Libraries in programming languages are collections of prewritten code that users can…

  • What happens when you type "ls -l *.c" in the shell

    What happens when you type "ls -l *.c" in the shell

    Navigating in a shell sometimes can be somewhat confusing. That's why there are so many options for the user.

  • Compilation as a process

    Compilation as a process

    First, I'd like to make a brief introduction onto why and when C was created. According to the Bell Labs paper The…

社区洞察

其他会员也浏览了