🌐

Understanding Domain Name System (DNS)

Dec 5, 2024

DNS (Domain Name System)

Introduction to DNS

  • DNS stands for Domain Name System.
  • It serves as the directory of the internet, connecting web browsers to web servers.

Purpose of DNS

  • Maps IP addresses to domain names and vice versa.
  • Allows users to access websites using human-friendly names instead of numeric IP addresses.
  • Uses port number 53 with UDP (default) and TCP protocols.
  • UDP is preferred for speed in DNS queries.

Components of DNS

1. Domain Name

  • Represents the location of a website.
  • Divided into three main categories:
    • Generic Domain: e.g., .com, .edu, .gov.
    • Country Domain: e.g., .uk for the United Kingdom, .in for India.
    • Inverse Domain: Maps IP addresses to domain names.

2. Namespace

  • Flat Namespace: All nodes directly connected to the root node, no structure.
  • Hierarchical Namespace: Organized structure with multiple levels (top-level domains, second-level domains).

3. Name Server

  • A server that stores DNS records (known as the phone book of the internet).
  • Types of records stored include:
    • Address record
    • Name server record
    • Mail exchanger record
  • Helps connect URLs with the IP addresses of web servers.

4. Name Resolver

  • Client software that maps domain names to IP addresses and vice versa.
  • Two types:
    1. Mapping a domain name to an IP address
    2. Mapping an IP address to a domain name

Working of DNS

  1. User enters a URL (e.g., www.eduresources1.com) into a web browser.
  2. The browser sends the URL to the DNS resolver.
  3. The DNS resolver queries the root server, which checks the type of domain (generic or country).
  4. Based on the domain (e.g., .com), the root server directs the request to the corresponding top-level domain server.
  5. The top-level domain server checks the second-level domain and fetches the associated IP address.
  6. The resolver returns the IP address back to the user's browser, which then connects to the web server.

Examples and Explanation

  • Generic Domain Example: eduresources1.com
    • .com is the top-level domain, eduresources1 is the second-level domain.
  • Country Domain Example: bcci.in
    • .in is the top-level domain for India, bcci is the second-level domain.

Conclusion

  • DNS is essential for mapping human-friendly website names to machine-readable IP addresses, facilitating user access to web services efficiently.
  • Any questions can be asked in the comments, and feedback is appreciated.