Translate

Search This Blog

Tuesday, 15 April 2025

Theory - 82 :- DNS Server

 

What is DNS?

DNS stands for Domain Name System. It is a hierarchical system that translates human-readable domain names (like www.google.com) into machine-readable IP addresses (like 192.168.1.1). Essentially, DNS acts as the internet's phonebook, mapping domain names to their corresponding IP addresses, allowing users to access websites using easy-to-remember names instead of numerical addresses.

When a user types a domain name into a web browser, the browser sends a request to a DNS server. The DNS server then looks up the corresponding IP address and connects the user to the appropriate web server, allowing the web page to be displayed in the browser.





How DNS Works

  1. User Input: A user enters a domain name (e.g., www.google.com) into a web browser.
  2. DNS Query: The browser sends a request to a DNS resolver, typically provided by the user's Internet Service Provider (ISP).
  3. Cache Check: The DNS resolver first checks its cache to see if it already has the IP address for the requested domain.
  4. Root Nameserver: If the IP address is not cached, the resolver queries a root nameserver, which directs it to the appropriate Top-Level Domain (TLD) nameserver (e.g., .com, .net).
  5. TLD Nameserver: The TLD nameserver provides the resolver with the IP address of the authoritative nameserver for the specific domain.
  6. Authoritative Nameserver: Finally, the authoritative nameserver returns the actual IP address associated with the domain name.
  7. Response to Browser: The resolver sends the IP address back to the browser, which can then connect to the web server and retrieve the requested web page.

Types of DNS Servers

  1. DNS Resolver: This server is responsible for receiving DNS queries from clients (like web browsers) and initiating the process of resolving the domain name into an IP address. It checks its cache first and, if necessary, queries other DNS servers.

  2. Root Nameserver: There are 13 sets of root nameservers globally. They serve as the first step in the DNS resolution process, directing queries to the appropriate TLD nameservers based on the domain extension.

  3. TLD Nameserver: TLD nameservers manage the domain extensions (like .com, .net, .edu). They store information about domains within their respective extensions and provide the IP address of the authoritative nameserver for a specific domain.

  4. Authoritative Nameserver: This server holds the actual DNS records for a domain, including the mapping of domain names to IP addresses. It provides the final answer to the DNS query.

Example of DNS in Action

When a user types "www.google.com" into their browser:

  1. The browser sends a request to the DNS resolver.
  2. The resolver checks its cache for the IP address.
  3. If not found, it queries the root nameserver, which directs it to the .com TLD nameserver.
  4. The TLD nameserver then points to the authoritative nameserver for google.com.
  5. The authoritative nameserver returns the IP address (e.g., 74.125.68.102).
  6. The resolver sends this IP address back to the browser, which then connects to Google's web server to retrieve the web page.

In summary, DNS is a crucial component of the internet, enabling users to access websites using easy-to-remember domain names while allowing computers to communicate using IP addresses.

0 comments:

Post a Comment

If you have any doubts, please let me know