π€ What is DNS? (Basic Idea)
Humans prefer names.
Computers understand numbers.
π Example:
Human-friendly name π
www.google.comComputer-friendly address π
142.250.195.46
π DNS acts as a translator between names and numbers.
π§ Simple Definition
π DNS (Domain Name System) is a distributed naming system that translates human-readable domain names into IP addresses.
π§ Why DNS is Needed
Imagine if you had to remember IP addresses like:
β 142.250.195.46
β 216.58.203.110
Instead of:
βοΈ google.com
βοΈ youtube.com
π That would be impossible π΅
π DNS solves this problem by:
Allowing users to use easy names
Converting them into IP addresses
π§ Real-Life Analogy
π Phone Contact List
You save a name β βMomβ
Phone internally stores the number
π DNS works the same way:
You type domain name
DNS finds the IP address
π§ Where Does DNS Belong in OSI Model?

DNS is an Application Layer protocol
Uses:
UDP (port 53) mostly
TCP (port 53) for large responses
π¦ What Does DNS Actually Do?
DNS performs:
π Name β IP translation
π IP β Name translation (reverse DNS)
π¬ Mail server lookup
π§ Load distribution
π DNS is much more than just name lookup.
π§± Structure of DNS (Hierarchical System)
DNS follows a hierarchical tree structure:
Root(.)
βββTop-LevelDomain(TLD)
βββSecond-LevelDomain
βββSubdomainπ§© Example: www.google.com
Part | Meaning |
|---|---|
. | Root |
com | Top-Level Domain |
Second-Level Domain | |
www | Subdomain |
π Types of DNS Domains
πΉ Top-Level Domains (TLDs)
Examples:
.comβ Commercial.orgβ Organization.eduβ Education.govβ Government.inβ India
πΉ Second-Level Domains
Registered by organizations
Example:
google,amazon
πΉ Subdomains
Created by organizations
Example:
mail.google.com
π§ DNS Server Types
DNS is distributed, not centralized.
π 1. Root DNS Server
Top of DNS hierarchy
Knows where TLD servers are
π There are 13 logical root servers worldwide.
π 2. TLD DNS Server
Manages domains like
.com,.org,.inDirects to authoritative servers
π’ 3. Authoritative DNS Server
Stores actual IP address of domain
Final answer provider
π Example:
Googleβs DNS server knows IP of
google.com
π» 4. Local DNS Server (Resolver)
Provided by ISP
First DNS contacted by your computer
π Acts as a middleman.
π How DNS Works (Step-by-Step)

Letβs say you type:
π www.google.com
πͺ Step-by-Step DNS Resolution
1οΈβ£ Browser checks cache
2οΈβ£ Query sent to Local DNS Server
3οΈβ£ Local DNS asks Root Server
4οΈβ£ Root replies with TLD server info
5οΈβ£ Local DNS asks TLD server
6οΈβ£ TLD replies with Authoritative server info
7οΈβ£ Local DNS asks Authoritative server
8οΈβ£ IP address returned
9οΈβ£ Browser connects to server using IP
π All this happens in milliseconds β‘
π§ DNS Caching (Performance Booster)
π DNS uses caching to:
Reduce delay
Reduce load on servers
Types of Cache:
Browser cache
OS cache
Local DNS cache
π Cached entries have TTL (Time To Live).
π Types of DNS Queries
πΉ Recursive Query
Client wants final answer
DNS server does all the work
π Most common type.
πΉ Iterative Query
DNS server gives partial answer
Client continues querying
π Used between DNS servers.
π Important DNS Record Types
Record | Purpose |
|---|---|
A | Domain β IPv4 address |
AAAA | Domain β IPv6 address |
CNAME | Alias to domain |
MX | Mail server |
NS | Name server |
PTR | IP β Domain (Reverse DNS) |
π§ Example DNS Records
google.comA142.250.195.46
google.com MX mail.google.com
www.google.com CNAME google.comβ‘ DNS over UDP vs TCP
Protocol | Usage |
|---|---|
UDP | Normal queries (fast) |
TCP | Zone transfers, large replies |
π Default DNS port: 53
π DNS Security Issues (Basic Idea)
DNS spoofing
DNS cache poisoning
π Modern solution:
DNSSEC (adds security)
βοΈ Definitions
π DNS:
DNS is a distributed naming system that translates domain names into IP addresses.
π Authoritative DNS Server:
A DNS server that stores the original IP address for a domain.
β Advantages of DNS
Easy to use Internet π
Scalable system
Fast resolution
Distributed & reliable
β Limitations of DNS
Security vulnerabilities
Dependency on caching accuracy
Initial lookup delay
π§ Memory Tricks
DNS = Internet Phonebook
A = Address record
MX = Mail exchange
β One-Line Summary
πΉ DNS translates human-readable domain names into IP addresses, enabling users to access Internet services easily.