What is DNS?
Have you ever wondered what happens when you type www.google.com or www.google.in into your web browser? You see the google.com webpage appear on your screen, but have you ever thought about how this works? The Domain Name System (DNS) manages a sophisticated operation behind the scenes. DNS, also known as the "internet's phonebook," functions as a huge directory that stores IP addresses of user-friendly domain names like google.com. It is a hierarchical and decentralized naming system that converts human-readable domain names (e.g., www.example.com) to machine-readable IP addresses (e.g., 192.168.1.1). It acts as the foundation for internet communication, allowing users to effortlessly access websites and online resources.
Key Functions of DNS
Domain-to-IP Translation: This process converts domain names into IP addresses, which computers use to locate resources.
Decentralized Control: Enables various organizations to oversee sections of the DNS without a central authority.
Redundancy: Guarantees continuous availability by utilizing a network of distributed and replicated servers across the globe.
Load Balancing: Channels traffic to the nearest or least-burdened server, enhancing performance.
How DNS works?
The process of DNS resolution invloves converting a domain name into an IP address. This procedure is known as DNS Query Resolution and generally follows to the following steps:
User Request: A user types
www.example.com
in the browser.Recursive Resolver: The query is sent to recursive DNS Resolver, provided by ISPs like Google Public DNA or Cloudflare DNA.
Root Server Query: The resolver requests the Root DNS Server for information regarding the Top-Level Domain (TLD), for example
.com
,.in
,.org
, etc.Authoritative Name Server Query: The TLD(Top-Level Domain) server provides the address of the Authoritative Name Server that oversees the particular domain.
Final Resolution: The authoritative server provides the domain's IP address, for example 98.765.432.10.
User Connection: The browser uses the IP address to link to the web server that hosts the web site.
Diagram of DNS Resolution Process
Types of DNS Servers
Recursive Resolver: Acts as a mediator between the user and various DNS servers. Examples includes Google DNS (8.8.8.8), Cloudflare (1.1.1.1).
Root Name Server: The primary server that forwards requests to TLD(Top Level Domain) servers. There are 13 logical root servers worldwide, each duplicated for backup purposes.
TLD Name Server: Manages information for top-level domains for example
.com
,.in
,.org
, etc.Authoritative Name Server: Stores IP address information for domains.
DNS Caching
Browser Cache: Temoporary storage of recently resolved domain names.
Operating System Cache: Caches DNS lookups(DNS lookups is process that converts domain names into IP addresses) for quick access.
Recursive Resolver Cache: Stores query results for subsequent requests.
DNS Query Types
Iterative Query: The resolver asks each DNS server for information, receiving partial answers.
Recursive Query: The resolver performs the entire lookup process on behalf of the client.
Reverse Query: Converts an IP address back to a domain name.
Importance of DNS
Simplifies Access: Users remember domain names rather than complex IP addresses.
Enables Scalability: Enables global internet expansion.
Supports Load Balancing: Directs traffic to the optimal servers to reduce latency.
Ensures High Availability: Distributed architecture eliminates single points of failure.
Applications of DNS
Website Access: Translates domain names into IP addresses, enabling users to visit websites.
Email Routing: Uses MX (Mail Exchange) records to route emails to the correct mail servers.
Load Balancing: Distributes traffic across various servers by utilizing CNAME records or advanced DNS methods such as GeoDNS.
Search Engine Optimization (SEO): Ensures domain names are properly set up and indexed by search engines.
Gaming and Streaming Platforms: Redirects users to the nearest servers for minimal latency.
Conclusion
DNS serves as a vital element of internet architecture, facilitating easy-to-use domain names while ensuring dependable and effective communication. With advancements such as DNSSEC and DoH, DNS is evolving to enhance security and prioritize privacy, tackling contemporary issues in an interconnected environment.