Topic DNS Fundamentals - korachi-9090/wiki GitHub Wiki

Topic: DNS Fundamentals

This topic covers the foundational concepts of Domain Name System (DNS), its structure, components, and role in network operations.

What is DNS?

The Domain Name System (DNS) is a hierarchical, distributed naming system for computers, services, or any resource connected to the Internet or a private network. Its primary function is to translate human-readable domain names (like www.example.com) into machine-readable IP addresses (like 192.168.1.1 or 2001:db8::1).

DNS Hierarchy

DNS is organized in a hierarchical tree structure:

                      Root (.)
                       / | \
                      /  |  \
         .com      .org  |  .net
        /    \     /     |     \
   example.com  acme.org | microsoft.net
      /   \               \
www.example.com          mail.microsoft.net

The DNS namespace is divided into levels:

  • Root Domain: Represented by a dot (.)
  • Top-Level Domains (TLDs): .com, .org, .net, .gov, .edu, country codes (.uk, .jp)
  • Second-Level Domains: example.com, microsoft.com
  • Subdomains: www.example.com, mail.example.com

DNS Components

DNS Servers

  • Authoritative Name Servers: Provide definitive answers for DNS queries about domains they control
  • Recursive Resolvers: Query other servers on behalf of clients to resolve domain names
  • Root Servers: Answer queries about top-level domains
  • Caching DNS Servers: Store DNS query results for a specified time to improve performance

DNS Zones

A DNS zone is a portion of the DNS namespace that is administered by a specific organization or administrator.

Types of zones:

  • Forward Lookup Zones: Map domain names to IP addresses
  • Reverse Lookup Zones: Map IP addresses to domain names
  • Primary Zone: Main copy of a zone where changes are made
  • Secondary Zone: Read-only copy that replicates from a primary zone
  • Stub Zone: Contains only the necessary resource records to identify authoritative DNS servers

Resource Records

DNS data is stored in resource records (RRs):

Record Type Purpose
A Maps a domain name to an IPv4 address
AAAA Maps a domain name to an IPv6 address
CNAME Creates an alias from one domain name to another
MX Directs email to a mail server
NS Delegates a DNS zone to a name server
PTR Maps an IP address to a domain name (reverse lookup)
SOA Specifies authoritative information about a DNS zone
SRV Specifies a service location
TXT Stores text information
CAA Specifies which certificate authorities can issue certificates

DNS Record Format

Each DNS record contains several fields:

  • Name: The domain name the record applies to
  • Type: The type of record (A, AAAA, MX, etc.)
  • Class: Usually "IN" for Internet
  • TTL (Time to Live): How long the record can be cached
  • Data: The value of the record (varies by type)

Example DNS record format:

www.example.com.  3600  IN  A  192.168.1.1

DNS Resolution Process

Iterative Resolution

  1. Client requests domain name resolution from its configured DNS server
  2. If the DNS server doesn't have the answer cached:
    • It queries the root servers
    • Root servers provide addresses of TLD servers
    • DNS server queries TLD servers
    • TLD servers provide addresses of authoritative servers
    • DNS server queries authoritative servers for the answer
  3. DNS server returns the answer to the client and caches it

Recursive Resolution

  1. Client requests domain name resolution from its configured DNS server
  2. DNS server takes full responsibility for resolving the request
  3. DNS server returns the complete answer to the client

DNS Resolution Diagram

Client                Local DNS Server           Internet DNS Hierarchy
  |                        |                              |
  |---Query: example.com-->|                              |
  |                        |---Query root servers-------->|
  |                        |<--Response: TLD servers------|
  |                        |---Query TLD servers--------->|
  |                        |<--Response: Auth servers-----|
  |                        |---Query Auth servers-------->|
  |                        |<--Response: IP address-------|
  |<--Response: IP addr----|                              |

DNS Caching

DNS servers cache query results to improve performance:

  • Positive Caching: Storing successful query results
  • Negative Caching: Storing information about failed queries
  • TTL (Time to Live): Specifies how long records can be cached

DNS in Windows Server

Windows Server includes a DNS Server role that:

  • Integrates with Active Directory
  • Supports dynamic updates from DHCP
  • Provides secure zone transfers
  • Supports DNS Security Extensions (DNSSEC)
  • Manages both forward and reverse lookup zones

Troubleshooting DNS

Common DNS troubleshooting tools:

  • nslookup: Interactive query tool for DNS lookup
  • dig: (Domain Information Groper) - Flexible DNS query tool
  • ipconfig /displaydns: Shows DNS resolver cache on Windows
  • ipconfig /flushdns: Clears DNS resolver cache on Windows
  • DNS Server logs: Records DNS server activity

Hands-on Activities

Related Terms


Back to Module: DNS and DHCP Services | Next Topic: Windows DNS Server Implementation

⚠️ **GitHub.com Fallback** ⚠️