What is DNS (Domain Name System) ?
DNS stands for Domain Name System. It is a fundamental component of the internet that translates human-friendly domain names (like www.example.com
) into IP addresses (like 192.0.2.1
) that computers use to identify each other on a network.
Key Features of DNS:
- Name Resolution:
- Converts domain names into IP addresses.
- Without DNS, users would need to remember numeric IP addresses instead of domain names.
- Hierarchical Structure:
- DNS operates as a distributed, hierarchical system.
- It consists of different levels of domains: Root, Top-Level Domains (TLDs) like
.com
or.org
, and Subdomains.
- Components of DNS:
- DNS Resolver: The client-side service that queries DNS servers.
- Authoritative DNS Server: Provides the actual IP address for a domain.
- Root Servers: Direct queries to appropriate TLD servers.
- TLD Servers: Provide information about authoritative servers for domains.
- Common DNS Record Types:
- A Record: Maps a domain to an IPv4 address.
- AAAA Record: Maps a domain to an IPv6 address.
- CNAME Record: Points a domain to another domain.
- MX Record: Specifies mail servers for a domain.
- Caching:
- To reduce latency and load, DNS results are cached at various levels (e.g., by ISPs or browsers).
How DNS Works:
- A user types a domain name in their browser.
- The browser sends a query to the DNS Resolver (usually provided by the ISP).
- The resolver queries a series of DNS servers:
- Root server → TLD server → Authoritative server.
- The authoritative server returns the IP address for the domain.
- The browser uses the IP address to connect to the desired website.
DNS is often called the “phonebook of the internet,” as it ensures that users can navigate the web with domain names rather than numerical addresses.