DNS
Domain Name System
DNS DOMAIN NAME SYSTEM
An application layer protocol defines how the application processes running on different systems, pass the messages to each other.
DNS is a TCP/IP protocol used on different platforms. The domain name space is divided into three different sections: generic domains, country domains, and inverse domain.
What is DNS Server
Name Space
1.Flat
2.Hierarchical
Flat Name Space
Characteristics:
Example 1: Local Network Devices
Suppose a small office has three computers:
Problem:
Example 2: Early Computer Networks (Before DNS)
Why Flat Naming Fails for the Internet?
Hierarchical Name Space
Characteristics:
Part | Managed By | Purpose |
.com | ICANN (Global Authority) | Top-Level Domain (TLD) for commercial sites |
example | Domain Registrar (e.g., GoDaddy) | Organization/Company Name |
www | Company’s IT Team | Specific server (e.g., web server) |
Key Differences (Flat vs. Hierarchical)
Advantages of Hierarchical Naming:
✅ Scalable (supports billions of names).�✅ Distributed control (no single authority needed).�✅ Avoids duplication (each level is unique).
Feature | Flat Name Space | Hierarchical Name Space |
Structure | Single-level (Server1) | Multi-level (server.company.com) |
Scalability | Only for small networks | Works for global systems (Internet) |
Management | Centralized (one admin) | Decentralized (ICANN, registrars, companies) |
Real-World Use | Old LAN systems | Modern DNS (Internet) |
DOMAIN NAME SPACE
. (root)
|
-------------------
| | |
com edu org
| | |
google mit wikipedia
/ \ | |
mail drive cs en
1. The DNS Tree Structure (Inverted Tree)
Imagine an upside-down tree where:
2. Key Rules of DNS
3. Real-World Examples
Example 1: Normal Website (www.amazon.com)
Example 2: University Website (cs.harvard.edu)
Example 3: Country-Specific Site (bbc.co.uk)
Example 4: Long Subdomain (shop.books.amazon.com)
Why This Structure?
✅ No Name Conflicts (only one google.com).�✅ Easy to Manage (companies control their own subdomains).�✅ Fast Lookups (DNS searches level by level).
1. .com (Commercial)
2. .edu (Education)
3. .uk (United Kingdom)
Label
1. What is a Label?
2. The Root Label
3. Label Uniqueness Rule
Domain Name
1. What is a Domain Name?
A domain name is a human-readable address that identifies a node in the DNS hierarchy. It is constructed as a sequence of labels separated by dots (.), read from left (specific) to right (general).
2. Structure of a Full Domain Name
Fully Qualified Domain Name [ FQDN ]
[host].[subdomain].[domain].[tld].
│ │ │ │ └── Root (null label, represented by .)
│ │ │ └── Top Level Domain (com, edu)
│ │ └── Second Level Domain (google, mit)
│ └── Subdomain (mail, www)
└── Host (server1, ns1)
Examples:
When Used:
1. Fully Qualified Domain Name (FQDN)
What it is:
When to use it:�✅ Global communication (e.g., accessing a public website).�✅ DNS configurations (e.g., zone files, dig commands).�✅ When precision is critical (e.g., connecting to a specific server).
Examples:
How it works:
Partially Qualified Domain Name [ PQDN ]
Definition: An incomplete address without a trailing dot, resolved relative to the local domain.�Format: [host] or [host].[subdomain]�Key Point: The local DNS adds the missing parts.
Examples:
When Used:
What it is:
When to use it:�✅ Local networks (e.g., office, school).�✅ Internal services (e.g., printers, intranet sites).�✅ Convenience (saves typing full names).
Examples:
How it works:
Why This Matters
Examples
Email Server Scenario
1. Fully Qualified Domain Name (FQDN)
Real-world example:�mail.google.com. (the trailing dot matters!)
Real-world example:�printer (in your office network)
Practical Impact:
Distribution of the DNS Namespace
The Domain Name System (DNS) is distributed across countless servers worldwide to ensure efficiency, reliability, and scalability. Below is a structured breakdown of how this works:
1. Why Distribute DNS?
Problems with a Centralized System
Solution: A Distributed Hierarchy
DNS divides responsibility among root servers, TLD servers, and authoritative name servers, ensuring:
Level | Server Type | Responsibility | Example |
Root | Root DNS Servers (13 globally) | Redirect queries to TLD servers | Points .com queries to .com servers |
Top-Level Domain (TLD) | TLD Servers (e.g., .com, .org) | Manage domain extensions | .com servers know where google.com is |
Authoritative | Authoritative Name Servers | Store actual DNS records for domains | google.com’s servers manage mail.google.com |
2. Hierarchy of DNS Servers
DNS is structured like an inverted tree, with different servers managing different levels:
Resolution, Resolver, and Iterative Resolution
1. DNS Resolution
What it is:�The process of translating a domain name (e.g., google.com) into an IP address (e.g., 142.250.190.46).
Example:
Key Point:�Resolution is the overall task of converting names to IPs.
2. DNS Resolver
What it is:�The software (or server) that performs DNS resolution. It can work iteratively or recursively.
Types:
Example:
Key Point:�A resolver is the tool that does the work.
3. Iterative Resolution
What it is:�A resolution method where the resolver contacts multiple servers step-by-step, getting referrals until it finds the answer.
Steps (Example for mail.google.com):
Key Point:
Term | Role | Example |
Resolution | The process of finding an IP | Converting google.com → 142.250.190.46 |
Resolver | The tool that performs resolution | Your ISP’s DNS server (8.8.8.8) |
Iterative Resolution | A method where the resolver queries servers step-by-step | Root → TLD → Authoritative (as above) |
Example
+---------+ +------------+ +-------------+ +-------------------+
| Client | ----> | Root Server| ----> | .COM Server | ----> | Authoritative |
| (Your PC)| | (.) | | (TLD) | | Server (google.com)|
+---------+ +------------+ +-------------+ +-------------------+
1. Query 2. Referral 3. Referral 4. Final Answer
"mail.google.com" "Ask .com" "Ask ns1.google.com" "142.250.190.46"
TYPES OF RECORDS
Two types of records are used in DNS. The question records are used in the question section of the query and response messages. The resourcerecords are used in the answer, authoritative, and additional information sections of the response message.
Question Record A question record is used by the client to get information from a server. This contains the domain name.
Resource Record Each domain name (each node on the tree) is associated with a record called the resource record. The server database consists of resource records. Resource records are also what is returned by the server to the client.
DNS MESSAGES
Two Types of DNS Messages
+---------------------+
| Header | (12 bytes - controls the message)
+---------------------+
| Question(s) | (What you're asking - e.g., "Where is google.com?")
+---------------------+
| Answer(s) | (The reply - e.g., "google.com = 142.250.190.46")
+---------------------+
| Authority (NS) | (Which servers are authoritative for the domain)
+---------------------+
| Additional Info | (Extra helpful data, like IPs of authoritative servers)
+---------------------+
REGISTRARS
1. What is a Registrar?
2. Steps to Register a Domain
3. Example: Registering ws.wonderful.com
After payment, the registrar:
4. Key Notes
🚀 TL;DR:
What You Provide | Example Value |
Domain Name | ws.wonderful.com |
Server IP Address | 200.200.200.5 |