Web Infrastructure: Understanding the Basics of DNS

Photo by Taylor Vick on Unsplash

Web Infrastructure: Understanding the Basics of DNS

Introduction

Have you ever wondered what happens when you type a web address into your browser’s address bar? How is it that your computer knows how to find the website you are looking for? The answer lies in the complex network of interconnected systems, servers, and protocols that make up web infrastructure. At the heart of this infrastructure lies the Domain Name System (DNS), which is responsible for translating what you typed in the address bar (domain names e.g. google.com) into what the computer can understand (IP addresses) and subsequently locating where the website is.

This article will be the first in a series that will explore the complex world of web infrastructure. Over the course of the series, we will delve into the inner workings of various systems, servers, and protocols that work together to create the internet as we know it today. By the end of this series, you will have a deep understanding of how web infrastructure works, and will be able to whiteboard your own web infrastructure. You will also be able to determine the issues that you may face when using one web infrastructure over the other.

If you are excited about this prospect, then come along for the ride! This series is designed for anyone who wants to gain a deeper understanding of the internet and how it works. Whether you are a student, a developer, a web designer, or just someone curious about technology, this series is for you. So let’s dive in and explore the fascinating world of web infrastructure!

Key Terms

Understanding how the DNS works are critical for anyone who wants to gain a deeper understanding of web infrastructure. At the end of this article, you should be able to explain to anyone how DNS enables users to access websites. But before we dive into the details of the DNS, let’s take a moment to define some of the key terms that you will need to understand to follow the discussion.

  • Server: Think of this as a computer with internet and if another word is mentioned before it, think of it as a computer that is connected to the internet and is responsible to store information pertaining to that word. I will discuss the server in a later article.

  • IP address: A unique numerical identifier assigned to every device connected to the internet. Every website also has an IP address. Some busy websites have more than one. You remembered how we were taught that computers only understand ‘0’ and ‘1’ in our basic computer class? Well, an IP address can translate to that. More details in a later article.

  • Resolver: It simply resolves domain names to IP addresses by contacting some servers. It is the errand boy!

  • Internet Service Provider (ISP): Yeah! You got it right. The Internet service provider is a company that provides internet access to users following some generally accepted rules.

  • Root server: A critical component of the DNS infrastructure. It knows the IP address of the TLD server for the domain you entered and will give the resolver when the resolver contacts it.

  • TLD: A Top-Level Domain (TLD) is the last part of a domain name, such as .com, .org, or .net.

  • Authoritative name servers: They are servers responsible for managing DNS records for a particular domain. Most domains have multiple name servers. It is the last stop for the resolver

Now that we have a basic understanding of these key terms, let’s explore the working of the DNS in more detail.

How DNS works

The Domain Name System, commonly referred to as DNS, is a critical component of the internet infrastructure that helps users access websites. DNS is considered the phone book of the internet and is responsible for converting human-readable domain names, such as google.com, into machine-readable IP addresses, such as 216.58.223.238, which are used by computers to locate and communicate with web servers.

When a user types a domain name into their browser’s address bar, the browser first checks its cache to see if it already knows the IP address for that domain. If it does not, the browser sends a request to the operating system (OS) to resolve the domain name. The OS also checks its cache to see if it has the IP address stored already. If it does not, the OS sends the request to a resolver, which is usually provided by the user’s Internet Service Provider (ISP).

The resolver is responsible for finding the IP address associated with the requested domain name. It first checks its cache to see if it has the answer already. If it does not, the resolver sends the request to the Top-Level Domain (TLD) server responsible for the domain’s extension. For example, if the requested domain is google.com, the resolver would contact the .com TLD server.

To find the TLD server, the resolver needs to know the location of the root server, which is at the top of the DNS hierarchy. The root server is like the phonebook for all the TLD servers. It knows the addresses of all the TLD servers and can direct the resolver to the appropriate one. Once the resolver has obtained the IP address of the TLD server, it stores it in its cache so that it does not have to make the same request again in the future.

When the resolver contacts the TLD server, it asks for the IP address of the domain name. If the TLD server knows the IP address, it returns it to the resolver else, it directs the resolver to the authoritative name servers responsible for the domain. These name servers are responsible for managing the domain’s DNS records.

Once the resolver has obtained the IP address from one of the name servers, it returns the answer to the OS. The OS then caches the IP address, so it does not have to make the same request in the future. Finally, the OS returns the IP address to the browser, which caches it as well so as not to ask for it again during your browsing session and makes the necessary request to the webserver to display the content of the website.

All of this happens in a matter of milliseconds and happens behind the scenes without the user even realizing it. Without DNS, you would need to memorize the IP addresses for every website you wanted to visit, which would be a daunting task.

Conclusion

In conclusion, DNS is a critical component of the internet’s infrastructure, and it’s what allows your computer to connect to the websites you want to visit. It is a complex system, but understanding how it works can give you a better appreciation for the incredible technology that powers the internet. In the next article, we will discuss different DNS record types and the role of each record type in managing or securing DNS records.

References

https://howdns.works/

https://smallbusiness.chron.com/domain-name-system-dns-resolvers-work-76639.html

https://en.wikipedia.org/wiki/Domain_Name_System

https://en.wikipedia.org/wiki/Root_name_server

https://support.dnsimple.com/articles/what-is-a-nameserver/

https://sematext.com/glossary/dns-lookup-time/#:~:text=The%20average%20DNS%20lookup%20time,is%20generally%20considered%20very%20good.