DNS | What is DNS | How does DNS work | Components of DNS | Purpose of DNS | Explain with animation
By Chirag Bhalodia
TechnologyEducation
Share:
Key Concepts
- DNS (Domain Name System): A directory service for the internet that translates domain names to IP addresses and vice versa.
- Domain Name: The human-readable address of a website (e.g., google.com).
- IP Address: The numerical address of a server on the internet (e.g., 192.168.1.1).
- Namespace: A hierarchical structure for organizing domain names.
- Name Server: A server that stores DNS records and provides name resolution services.
- Name Resolver: A client-side component that queries name servers to resolve domain names.
- Generic Domain: Top-level domains like .com, .edu, .org.
- Country Domain: Top-level domains specific to countries like .in (India), .au (Australia).
- Inverse Domain: Used for reverse DNS lookups (IP address to domain name).
- Zone: A portion of the domain namespace for which a name server has authority.
- Root Server: The top-level name servers in the DNS hierarchy.
- Primary Server: The authoritative name server for a zone.
- Secondary Server: A backup name server that replicates data from the primary server.
- Recursive Query: A DNS query where the server must return a complete answer or an error.
- Iterative Query: A DNS query where the server provides the best answer it can, possibly referring the client to another server.
1. Introduction to DNS
- Definition: DNS (Domain Name System) translates domain names (e.g., google.com) to IP addresses, enabling users to access websites using names instead of numerical IP addresses.
- Analogy: DNS is like a telephone directory for the internet, mapping names to numbers.
- Purpose: To map IP addresses to domain names and vice versa, making it easier for humans to remember and use website addresses.
- Port Number: DNS uses port 53 with both UDP and TCP protocols. UDP is the default due to its speed for immediate responses.
- Question: Why does DNS use UDP instead of TCP, and when does DNS use TCP instead of UDP? (Left as an exercise for the viewer).
2. Components of DNS
2.1 Domain Name
- Definition: The location of a website on the internet. Web pages are stored on web servers connected to specific domains.
- Categories:
- Generic Domains: Three-character domains (now also two and four-character) like .com (commercial), .edu (educational), .gov (government), .int (international), .mil (military), .net (network support), .org (non-profit).
- Example:
eduresources1.com
is a generic domain..com
is the top-level domain, andeduresources1
is the second-level domain.
- Example:
- Country Domains: Two-character domains representing countries, like .in (India), .au (Australia).
- Example:
bcci.in
is a country domain..in
is the top-level domain, andbcci
is the second-level domain.
- Example:
- Inverse Domains: Used for mapping IP addresses to domain names (reverse DNS lookup).
- Process: A user queries with an IP address. The query goes to the root server, then to the inverse domain. The inverse domain (using the
arpa
domain) maps the IP to a domain name and returns it. - Example: A user enters the IP address
132.35.50.120
. The inverse domain structure is120.50.35.132.in-addr.arpa
. This IP might map toeduresources1.com
.
- Process: A user queries with an IP address. The query goes to the root server, then to the inverse domain. The inverse domain (using the
- Generic Domains: Three-character domains (now also two and four-character) like .com (commercial), .edu (educational), .gov (government), .int (international), .mil (military), .net (network support), .org (non-profit).
2.2 Namespace
- Flat Namespace: All domain names are directly connected to the root server.
- Limitations: Not scalable for the internet's size, overloads the central authority (root server), and lacks structure.
- Hierarchical Namespace: Domain names are organized in a tree-like structure with levels (top-level, second-level, etc.).
- Structure: Root node -> Top-level domains (generic, country, inverse) -> Second-level domains -> etc.
- Example:
eduresources1.com
in a hierarchical namespace: Root node connects to.com
(generic), which connects toeduresources1
.
2.3 Name Server
- Definition: A server that stores DNS records (address records, name server records, mail exchanger records). It's like a phone book for the internet.
- Purpose: Connects URLs with the IP addresses of web servers.
- Hierarchy: Root server -> Top-level domain servers (e.g.,
.com
,.in
,arpa
) -> Second-level domain servers. - Zone: A database created by a server. Root servers can delegate authority to zones.
- Domain vs. Zone:
- Same: When a domain is not divided into subdomains.
- Different: When a domain is divided into subdomains, and authority is delegated to other servers.
- Root Server: A server that contains the full DNS tree.
- Types of Servers:
- Primary Server: Holds the authoritative zone file and is responsible for updates.
- Secondary Server: Loads zone information from the primary server and acts as a backup.
2.4 Name Resolver
- Architecture: DNS uses a client-server architecture.
- Definition: Client software that maps domain names to IP addresses and vice versa.
- Types:
- Mapping Domain Name to IP Address: The resolver queries a DNS server with a domain name and receives the corresponding IP address.
- Mapping IP Address to Domain Name: The resolver queries a DNS server with an IP address and receives the corresponding domain name (using the inverse domain).
- Methods:
- Recursive Method: The resolver asks a server to fully resolve the query. If the server doesn't know the answer, it queries other servers on behalf of the resolver until it finds the answer.
- Example: A user tries to access
eduresources1.com
while connected toamazon.in
. Theamazon.in
server queries the.com
server, which queries theeduresources1.com
server, and the answer is passed back to the user.
- Example: A user tries to access
- Iterative Method: The resolver queries a server, and if the server doesn't know the answer, it refers the resolver to another server. The resolver then queries that server, and so on, until it finds the answer.
- Example: A user tries to access
eduresources1.com
while connected toamazon.in
. Theamazon.in
server refers the resolver to the.in
server, which refers it to the root server, which refers it to the.com
server, which finally provides the IP address foreduresources1.com
.
- Example: A user tries to access
- Recursive Method: The resolver asks a server to fully resolve the query. If the server doesn't know the answer, it queries other servers on behalf of the resolver until it finds the answer.
3. Working of DNS
- Process:
- A user enters a URL (e.g.,
www.eduresources1.com
) into a web browser. - The browser sends the URL to the DNS resolver.
- The resolver sends the URL to the root server.
- The root server identifies the top-level domain (
.com
) and forwards the query to the.com
name server. - The
.com
name server checks the second-level domain (eduresources1
). If the domain is registered with a specific name server (e.g., Google's name server), the query is forwarded there. - Google's name server finds the corresponding IP address for
eduresources1.com
and returns it to the DNS resolver. - The resolver sends the IP address to the user's web browser.
- The browser uses the IP address to connect to the
eduresources1.com
web server. - The web server sends the requested page to the user's browser, and the page is displayed.
- A user enters a URL (e.g.,
4. Conclusion
The DNS is a critical component of the internet, enabling users to access websites using human-readable domain names. It involves a hierarchical structure, various types of name servers, and different query methods to efficiently translate domain names to IP addresses and vice versa. Understanding the components and working of DNS is essential for anyone involved in computer networking or web development.
Chat with this Video
AI-PoweredHi! I can answer questions about this video "DNS | What is DNS | How does DNS work | Components of DNS | Purpose of DNS | Explain with animation". What would you like to know?
Chat is based on the transcript of this video and may not be 100% accurate.