• February 23, 2024
  • nitesh taliyan
  • 0

In this blog we will delve into the core concepts of the Domain Name System (DNS) – the backbone of the internet. We’ll uncover what DNS is, how it functions, and why it’s essential for our online experience. From translating human-readable domain names to machine-readable IP addresses to navigating the hierarchical structure of DNS servers, we’ll embark on a journey to demystify this crucial component of the digital world. So, let’s begin our exploration and gain a deeper understanding of the inner workings of DNS.

DNS, or Domain Name System, is the backbone of the internet. It translates human-readable domain names, such as google.com, to machine-readable IP addresses. DNS is a little confusing because there are different types of DNS servers in the DNS hierarchy, each serving a different purpose.

When a browser makes a DNS query, it’s asking a DNS resolver. This DNS resolver could be from our ISP or from popular DNS providers like Cloudflare’s 1.1.1.1 or Google’s 8.8.8.8. If the DNS resolver does not have the answer in its cache, it finds the right authoritative nameserver and asks it. The authoritative nameserver is the one that holds the answer.

How does the DNS resolver find the authoritative nameserver? This is where the system of DNS gets interesting. There are three main levels of authoritative DNS servers. They are the root name servers, the top-level domain (TLD) name servers, and the authoritative nameservers for the domains.

The root name servers store the IP addresses of the TLD name servers. There are 13 logical root name servers, each with a single IP address assigned to it. There are actually many physical servers behind each IP address. Through anycast, we get routed to the one closest to us.

The TLD name servers store the IP addresses of the authoritative nameservers for all the domains under them. There are many types of TLD names like .com, .org, and .edu. There are also country code TLDs like .de and .uk.

The authoritative nameservers for a domain provide authoritative answers to DNS queries. When we register a domain, the registrar runs the authoritative nameservers by default, but we can change them to others. Cloud providers like AWS and Cloudflare run robust authoritative nameservers.

This hierarchical design makes DNS highly decentralized and robust.

Let’s walk through the life of a typical DNS query:

  • The user types google.com into the browser. The browser first checks its cache. If it has no answer, it makes an operating system call to try to get the answer. The operating system call would most likely have its own cache.
  • If the answer isn’t there, it reaches out to the DNS resolver. The DNS resolver first checks its cache. If it’s not there or if the answer has expired, it asks the root name server.
  • The root name server responds with the list of the .com TLD name servers. Note that since .com is such a common TLD, the resolver most likely already caches the IP addresses for those .com TLD nameservers.
  • The DNS resolver then reaches out to the .com TLD nameserver, and the .com TLD nameserver returns the authoritative nameservers for google.com.
  • Finally, the DNS resolver reaches out to google.com’s authoritative nameserver, and it returns the IP address of google.com. The DNS resolver then returns the IP address to the operating system, and the operating system returns it to the browser.

Let’s go over some gotchas when updating DNS records for a live, high-traffic production system. DNS propagation is slow because there is a TTL on each DNS record, and some of the default TTLs are pretty long. Also, not every DNS resolver is a good citizen and honors the TTL.

To mitigate the risk, there are two practical steps to take:

  • First, reduce the TTL for the record that we want to change to something very short, say 60 seconds, well in advance before the update actually happens. This gives ample time for all the DNS servers to receive the shortened TTL, which would allow the actual record update to take effect based on the new shortened TTL.
  • Second, leave the server running on the old IP address for a while. Only decommission the server when traffic dies down to an acceptable level. Because some DNS resolvers don’t honor the TTL, this could take a bit of time and patience.

If you want to know more, click on the link below

GeeksforGeeks

AWS

Conclusion

We’ve uncovered the vital role of DNS as the internet’s backbone. From translating domain names to IP addresses to navigating its hierarchical structure, we’ve grasped its significance in ensuring seamless online connectivity. As we conclude this introductory journey, let’s remember DNS’s indispensable contribution to our digital experiences.

Thanks for reading to the end; I hope you gained some knowledge.