DNS Simplified
How the Internet’s Address Book Works.

Introduction
The Domain Name System (DNS) is the backbone of the internet, which translates human-friendly domain names into machine-readable IP addresses. It simplifies navigation by allowing users to type names like google.com instead of remembering complex numerical addresses.
In this article, we’ll explore domains, their structure, the concept of DNS, how it works, and its importance in making the internet user-friendly.
All Computers on the internet, from a smart phone, laptop, server, find and communicate with each other using numbers. These numbers are called as IP addresses. When you open a web browser and go to a website, you don't have to remember and enter a long number. Instead, you can enter a domain name like google.com and still end up in the right place.
Domain names make it easy to find and access resources across different systems, networks, and organizations. When we type a domain name, a resolver processes it to find and get the information linked to that name, such as IP addresses. To the user, it looks like a simple system—a single domain tree—but in reality, the resolver works with many name servers to make sure everything works smoothly.
Structure of Domain

A domain is a string that users type into their browser, consisting of three parts:
Subdomain: The prefix, such as www. or blog.
2nd Level Domain: The main name, such as google in google.com.
Top-Level Domain (TLD): The suffix, like .com, .org, or .edu.
These parts are separated by dots, creating a fully qualified domain name (FQDN), such as www.devwithjay.com. This structure makes it easier for users to access websites by typing readable names instead of numerical IP addresses.
A domain name is not the same as a URL (Uniform Resource Locator).
A URL is the full web address of a site.
It includes the domain name and other details, like:
The protocol (e.g., HTTP or HTTPS) used to access the page.
The path to a specific file or folder on the website (e.g., https://ww.blog.devwithjay.com/journey-of-data).
What is DNS?
DNS acts like the internet’s phonebook, translating domain names into IP addresses so that devices can locate and connect to servers. Just like we don’t memorize phone numbers anymore because our phone stores them under contact names, DNS helps us avoid memorizing IP addresses by linking them to domain names.
When new addressing systems are introduced, they always bring the challenge of creating a way to map one type of address to another. In the early days of networking, MAC (Media Access Control) addresses were the foundation. These unique identifiers worked well for local communication but weren’t designed for routing across large networks. To address this limitation, IP addresses were introduced. Even with this advancement, MAC addresses remain essential within local networks, which is why the Address Resolution Protocol (ARP) was developed. ARP bridges the gap by mapping IP addresses to their corresponding MAC addresses.
A similar challenge arises with domain names and IP addresses, which is where the Domain Name System (DNS) comes in. People know websites by their domain names, like Facebook.com, but computers need the corresponding IP address to connect to the server. DNS resolves this by acting as a translator. It typically uses the User Datagram Protocol (UDP) on Port 53, though it can operate on other ports. Once DNS provides the IP address for a domain, the device can establish communication with the server. If the connection is local, ARP may further resolve the IP address to a MAC address.
Every device on the Internet has a unique IP address, which other devices use to locate it. Thanks to DNS, people don’t need to remember complex IP addresses, such as 192.168.1.1 for IPv4 or longer alphanumeric addresses like 2400:cb00:2048:1::c629:d7a2 for IPv6. DNS is used to simplify this process, making the Internet easier to use.
Why do we need DNS?
Imagine having to memorize an IP address like 172.217.10.46 for every website you visit. That would be impractical!
DNS makes the internet easier to use by providing a layer of abstraction:
Users only need to remember domain names, while DNS manages the mapping to IP addresses.
DNS also handles changes in IP addresses caused by server updates or load balancing, ensuring users always reach the correct destination.
Without DNS, the internet would be far less user-friendly and scalable.
Working of DNS
DNS is not just a simple database where you query for a name and get an IP address. If it were built like that, the database would be massive, containing millions of records. To handle this, DNS uses partitioning to divide the data into smaller, manageable sets. This is similar to splitting a large table into smaller parts in a database.
DNS works in layers
Root Servers: The top level of DNS, which directs queries to the next level.
Top-Level Domain (TLD) Servers: These servers handle specific domains like .com, .org, .net, or country-specific domains like .in.
Authoritative Name Servers (ANS): These servers store the actual IP address for the requested domain, like google.com.
When you connect to a network, your device gets a default DNS resolver (usually your router or a public resolver like 8.8.8.8 from Google or 1.1.1.1 from Cloudflare).
The resolver checks if it already has the answer (cached). If not, it starts querying other servers step by step.
Querying Process

Step 1: The client sends a request to the resolver, asking for the IP address of a website (e.g., google.com).
Step 2: The resolver sends a query to a root server, asking for the TLD server of the domain (e.g., .com for google.com).
Step 3: The root server replies with the IP address of a TLD server that handles .com domains.
Step 4: The resolver queries the TLD server, asking for the authoritative name server for google.com.
Step 5: The TLD server responds with the IP address of the authoritative name server.
Step 6: The resolver asks the authoritative name server for the IP address of google.com.
Step 7: The authoritative name server responds with the IP address, which is then sent to the resolver.
Step 8: Once the resolver gets the IP address of the domain, it sends this IP address to the client.
Step 9: The client then uses this IP address to establish a connection with the server, such as initiating a TCP handshake.
Why this Long Process is Required?
This layered approach reduces the size of individual databases and improves efficiency. Each server in the hierarchy only manages a specific part of the DNS structure, making it scalable and reliable.
Caching
To speed up responses, DNS resolvers and browsers temporarily store frequently accessed domains in their cache. This avoids repeatedly asking DNS servers for the same information, making responses faster and saving resources.
Load Balancing
DNS can give multiple IP addresses for the same domain. This spreads traffic across different servers, preventing any one server from getting too much load. It makes websites faster and more reliable.
Geo-DNS
DNS sends users to servers closest to their location. This reduces delays and makes websites load faster, especially for global users.
How does DNS match responses to queries if it uses UDP?
Each query contains a unique transaction ID to match responses with their respective requests. This ensures that the resolver can correctly identify which response corresponds to which query, even when multiple queries are processed simultaneously.
DNS Challenges
Plaintext Queries: Traditional DNS queries are unencrypted, meaning your internet service provider (ISP) or other entities can see which websites you visit.
Encryption Solutions: Technologies like DNS-over-HTTPS (DoH) and DNS-over-TLS (DoT) are being adopted to encrypt DNS queries.
Vulnerabilities: DNS is vulnerable to attacks like:
DNS Cache Poisoning: Attackers inject fake responses into a resolver’s cache.
Hijacking: Attackers redirect users to malicious servers.
What is DDNS?
Many websites and online services, like APIs, run on internet connections with IP addresses that change frequently. This can be a problem for website owners who want their domain name to always point to the correct server. A domain name needs to be linked to an IP address in the Domain Name System (DNS), so if the IP address changes, the link breaks.
This is where Dynamic DNS (DDNS) comes in. DDNS is a service that automatically updates DNS records with the correct IP address, even if it keeps changing.
For example, imagine a small website called www.example.com with an IP address of 192.0.2.0. Whenever someone types www.example.com into their browser, the DNS directs them to the server at that IP address. If the website’s internet provider changes the IP address to 192.0.2.1, a DDNS service updates the DNS records automatically. This ensures visitors are always sent to the right server, no matter how often the IP changes.
Conclusion
In this article, we understood that DNS is the backbone of the internet, bridging the gap between human-friendly domain names and machine-friendly IP addresses. It’s a decentralized, efficient, and robust system that allows the internet to function as we know it. Whether you’re browsing a website, sending an email, or using a cloud service, DNS is silently working in the background.
If you found this article helpful, share it with others and feel free to leave your feedback—I’d love to hear your thoughts!
Want More…?
I write articles on blog.devwithjay.com and also post development-related content on the following platforms:




