Domain Name Systems (DNS)

Domain Name Systems (DNS)

The Internet (SERIES) - Blog #4

The Problem

Everyone knows and loves at least one website. There is facebook.com, github.com, hashnodenode.com, and a lot more! However, in the background servers can't understand facebook.com they only understand IP addresses. Human and server miscommunication And well humans... aren't good at remembering tons of IP addresses. So... we need a translator. Someone (or something) to translate website URLs to IP addresses. This is where the Domain Name System or DNS comes in.

What it does

DNS takes in a domain name (like facebook.com) and resolves (translates) it into an IP address.

DNS Lookup Process

So let us say you're on your computer and want to browse Facebook. You type in facebook.com and the first thing your computer does is check its local cache (or records) it'll see if it has facebook.com's IP address. Step 1 If your local cache doesn't have the IP address needed, it will query (ask) a DNS Recursive Resolver, typically provided by your ISP (this can be changed to a different one like Google DNS). The DNS Recursive Resolver will check its cache to see if it has the IP address. Step 2 If it doesn't then it will ask a root server. A root server can provide the details for a Top-Level Domain (TLD) server. Examples of Top Level Domain servers are the .com servers, the .net servers, the .org servers, etc. This root server will receive the request and give the needed details for the appropriate TLD server. In the case of the .com servers. Steps 3 & 4 Then our DNS Recursive Resolver asks the appropriate TLD server. In this case, the .com TLD server. Steps 5 & 6 The TLD may still not know the IP address of facebook.com but it can provide the location of the Authoritative Name Server. The Authoritative Name server is the last step in the DNS Lookup. Steps 7 & 8 This server will most likely have the IP we are looking for and it will provide the IP address we are looking for! Steps 9 & 10 After we receive our hard-earned IP address (in a response from our DNS Recursive Resolver, we can now request what we need (the page, data, etc.) from Facebook's servers.

Conclusion

That was a lot of steps (10 steps), but it usually happens extremely quickly. This is why it takes some time for a page to load if you haven't visited that webpage, it needs to go through some or all of the steps to find the IP address of the website you want to visit. So the next time a webpage loads slowly remember your computer's processes in the background.

ย