DNS (Domain Name System)


: The Internet’s Phonebook in Simple Terms
DNS - Domain Name System - resolves domain names —> IP addresses.
That is, the backbone of the internet, which translates human-friendly domain names into machine-readable IP addresses.
For example,
When you open a web browser and go to a website, you don't have to remember and enter a long number(IP address). Instead, you can enter a domain name like google.com and still end up in the right place.
Thus, Domain names make it easy to find and access resources across different systems, networks, and organizations.
Structure:
A domain is a string - users type into their browser,
Consisting of three parts:
Subdomain: The prefix, such as www.
2nd-Level Domain: The main name, such as "google" in "google.com".
Top-Level Domain (TLD): The suffix, like .com, .org*, or **.edu*.
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.
DNS:
Thus, acts like the Internet’s phonebook, translating domain names into IP addresses so that devices can locate and connect to servers.
History:
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 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.
DNS-Query 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.
: Note- The client then uses this IP address to establish a connection with the server, such as initiating a TCP handshake.
Advantages:
Layered approach - reduces the size of individual databases and improves efficiency.
Each server in the hierarchy - 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.
Challenges:
Plaintext Queries: Traditional DNS queries are unencrypted- client Internet Service Provider (ISP) or other entities can see which websites he visits.
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.
DDNS: Dynamic DNS
Problem:
: Many websites and online services, like APIs, run on internet connections with IP addresses that change frequently.
: 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 DNS, so if the IP address changes, the link breaks.
Solution:
Dynamic DNS[DDNS] - a service that automatically updates DNS records with the correct IP address, even if it keeps changing.
For example,
: Imagine a small website called example.com - IP Address - 192.0.2.0.
: Whenever someone types 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:
We understood that DNS is the backbone of the internet, bridging the gap between human-friendly domain names and machine-friendly IP addresses.
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!
Subscribe to my newsletter
Read articles from Nandini Bajaj directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Nandini Bajaj
Nandini Bajaj
Passionate IT student with strong Java and Data Structures & Algorithms skills, actively enhancing coding proficiency via LeetCode. Excited by fast-paced, creative environments and looking to participate in hackathons to gain real-world exposure, build innovative solutions, and grow as a developer through teamwork and iteration.