Domain Name System and Name Server

What is DNS?

DNS (Domain Name System) is the entire system and process that translates human-readable domain names (like clearfunda.com) into IP addresses (like 192.0.2.1), which computers use to identify each other on the internet. This system allows users to access websites without needing to remember IP addresses. The DNS process involves multiple steps, with different types of name servers playing key roles at various stages to achieve this translation effectively.

alt text

What is a Name Server?

A Name Server is a general term for any server that handles DNS queries. There are different types of name servers involved in the DNS resolution process. Here’s a detailed breakdown of each, with examples and their roles in order.

1. Recursive Name Server / DNS resolver

A Recursive Name Server (also called a DNS resolver) is responsible for starting the process of resolving a domain name to an IP address on behalf of the client. It will query other DNS servers (root, TLD, and authoritative servers) until it finds the answer.

When you type clearfunda.com in your browser, your computer sends the query to a recursive name server, often provided by your ISP or a public DNS service like Google DNS (8.8.8.8) or Cloudflare DNS (1.1.1.1). This server will either respond with the IP address from its cache or proceed to ask other servers.

!NOTE: Internet Service Provider (ISP) vs DNS Resolver

An Internet Service Provider (ISP) may or may not function as a DNS resolver. Here’s a breakdown of how this works:

When ISPs Act as DNS Resolvers

  1. Default DNS Resolver: Many ISPs provide their own DNS resolvers as part of their internet service. When you connect to the internet through your ISP, your device is often configured to use the ISP's DNS servers by default.
  2. Example: An ISP like BT (British Telecommunications) in the UK may have its own DNS servers that automatically resolve domain names for its customers.
  3. Advantages: Using an ISP’s DNS resolver can lead to faster query times because the resolver is often geographically close to the user. ISPs may also cache frequently accessed domains, improving resolution times for common requests.

When ISPs Do Not Act as DNS Resolvers

  1. Custom DNS Settings: Some users prefer to use third-party DNS resolvers for various reasons, such as improved speed, privacy, or additional security features. In these cases, users can manually configure their devices or routers to use public DNS services like:
  2. Google DNS (8.8.8.8 and 8.8.4.4)
  3. Cloudflare DNS (1.1.1.1 and 1.0.0.1)
  4. OpenDNS (208.67.222.222 and 208.67.220.220)
2. Root Name Server

The Root Name Server is the first stop for a DNS query from a recursive name server when the answer is not cached. While it doesn’t have the IP address of the requested domain, it knows the locations of the TLD servers.

There are 13 sets of root name servers identified by letters A through M, which are distributed worldwide to ensure reliability and redundancy. These root servers are managed by different organizations, including:

  1. VeriSign: Manages the A and J root servers.
  2. University of Southern California's Information Sciences Institute (USC-ISI): Manages the B root server.
  3. NASA: Manages the C root server.
  4. Internet Systems Consortium (ISC): Manages the D root server.

When the recursive name server queries a root server for clearfunda.com, the root server responds by pointing it to the .com TLD server. This process ensures that DNS queries are efficiently routed through the hierarchical structure of the DNS system.

3. TLD Name Server

The Top-Level Domain (TLD) Name Server is responsible for knowing the authoritative name servers for domains within a specific TLD, such as .com, .org, or country-specific TLDs like .in. For instance, the TLD name server for .com domains is managed by VeriSign, while the TLD servers for .org domains are managed by the Public Interest Registry (PIR).

When a DNS query reaches the root server, it directs the request to the appropriate TLD name server based on the domain extension. For example, after the root server directs the query to the .com TLD server managed by VeriSign, the recursive resolver then contacts this TLD server. The .com TLD server points the resolver to the authoritative name server for clearfunda.com, allowing the resolution process to continue.

4. Authoritative Name Server

The Authoritative Name Server is responsible for holding the definitive DNS records for a domain, such as clearfunda.com. This server is the final stop in the DNS lookup process, providing the official IP address or other DNS information that directs traffic to the correct web server.

Popular DNS providers like Amazon Route 53, GoDaddy, and Cloudflare offer authoritative DNS services. When a domain is registered with one of these providers, they become the authoritative source for that domain’s DNS records.

For example, when the recursive resolver queries the authoritative name server for clearfunda.com, if Amazon Route 53 is set up as the authoritative name server, it will respond with the IP address for clearfunda.com. This allows the recursive resolver to return the IP address to the user's browser, completing the lookup process and connecting the user to the correct website.

How DNS and Name Servers Work Together with example

Here's a simplified step-by-step process of how DNS resolves a domain name:

  1. User Request: The user types a domain name (clearfunda.com) into a browser.
  2. Browser Cache Check: The browser first checks its cache to see if it has recently accessed this domain and if the IP address is stored locally. If not, it continues to the next step.
  3. Operating System (OS) Cache Check: The OS checks its DNS cache. If it finds the IP, the process ends here. If not, it forwards the query.
  4. Query to Local DNS Resolver: The request is sent to the local DNS resolver (often provided by the ISP).
  5. Root DNS Server: If the local DNS resolver doesn't have the IP, it queries one of the Root DNS Servers, which respond with the address of the Top-Level Domain (TLD) Name Server (e.g., for .com domains).
  6. TLD Name Server: The TLD Name Server provides the IP address of the Authoritative Name Server for clearfunda.com.
  7. Authoritative Name Server: This server has the exact IP for clearfunda.com and returns it to the local DNS resolver.
  8. Response to User: The local DNS resolver sends the IP address back to the browser.
  9. Connecting to Website: With the IP address, the browser establishes a connection to clearfunda.com, displaying the website.
User's Device (e.g., Laptop/Phone)
          |
          v
       Wi-Fi Router
          |
          v
   Local DNS Resolver (ISP's DNS Server)
          |
          v
     Root DNS Server
          |
          v
     TLD Name Server (e.g., .com)
          |
          v
   Authoritative Name Server (clearfunda.com)
          |
          v
   Response to Local DNS Resolver
          |
          v
       Wi-Fi Router
          |
          v
   User's Device (Displays Website)