4.3.23 · D1 · HinglishComputer Networks

FoundationsDNS — recursive vs iterative query, hierarchy, record types (A, AAAA, CNAME, MX, NS)

1,853 words8 min read↑ Read in English

4.3.23 · D1 · Coding › Computer Networks › DNS — recursive vs iterative query, hierarchy, record types

Isse pehle ki tum recursive vs iterative queries, record types, ya hierarchy follow kar sako, tumhe har woh word aur symbol khud se samajhna hoga jo parent note quietly assume karta hai. Yeh page har ek cheez ko zero se build karta hai, ek aisi order mein jahan har piece apne pehle wale piece pe tikki hoti hai.


1. "Name" kya hota hai aur "number" kya hota hai?

Picture yeh hai: ek phonebook imagine karo. Name hai "Annie Sharma"; number hai "555-0142". Tum naam yaad rakhte ho; phone system number dial karta hai.

Figure — DNS — recursive vs iterative query, hierarchy, record types (A, AAAA, CNAME, MX, NS)

Yeh topic ko kyun chahiye: DNS ka poora reason yahi name→number gap hai. Agar humans 128-bit numbers yaad rakh paate, toh DNS ka koi matlab nahi hota. (Do number formats ke baare mein zyada IP Addressing — IPv4 vs IPv6 mein.)


2. Dot, aur kyun hum names ko right-to-left padhte hain

Yeh topic ko kyun chahiye: poori hierarchy (root → TLD → domain → host) literally ek name ko right-to-left, ek dot at a time padhna hai.


3. Tree, node, branch, delegation

Figure — DNS — recursive vs iterative query, hierarchy, record types (A, AAAA, CNAME, MX, NS)

4. Client, server, resolver

Picture yeh hai: stub resolver woh student hai jo school office se ek sawaal poochta hai. Recursive resolver woh office clerk hai jo saare phone calls karta hai aur final number de deta hai.

Yeh topic ko kyun chahiye: recursive aur iterative queries mein farq poori tarah kaun running around karta hai — clerk (recursive resolver) ya poochne wala (stub) — iske baare mein hai. In dono roles ko samajh lo aur woh poora section obvious ho jaata hai.


5. Query, referral, authoritative answer

Figure — DNS — recursive vs iterative query, hierarchy, record types (A, AAAA, CNAME, MX, NS)

6. Record, TTL, cache


7. Priority (MX records ke liye zaroori)

Yeh topic ko kyun chahiye: MX records mein yeh numbers hote hain, aur classic mistake yeh sochna hai ki bada number zyada important server hai. Yeh ulta hai.


Yeh foundations topic ko kaise feed karte hain

Hostname vs IP address

Labels and the dot

Tree and delegation

Root TLD Authoritative hierarchy

Client server resolver roles

Recursive vs Iterative query

Query referral authoritative answer

Record type value TTL

A AAAA CNAME MX NS records

Cache and TTL

Why DNS scales

Priority number

DNS full lookup flow


Equipment checklist

Right side cover karo aur khud test karo. Agar koi line shaky hai, uska section upar se dobara padho.

Hostname hota hai
machine ka human-readable naam, jaise www.example.com — sirf text, human memory ke liye.
IP address hota hai
woh numeric location jahan packets actually deliver hoti hain (IPv4 93.184.216.34, ya lamba 128-bit IPv6).
Hum domain name padhte hain
right-to-left, sabse-senior (broadest) label pehle — jaise country → city → street.
FQDN hota hai
ek naam poori tarah root tak likha, trailing dot se mark kiya: www.example.com..
Delegation ka matlab hai
har level sirf next level ka pointer store karta hai, kabhi poora answer nahi.
Stub resolver hai
tumhare laptop ka dumb DNS client jo ek sawaal poochta hai aur wait karta hai.
Recursive resolver hai
woh helper server jo saari running around karta hai aur answers cache karta hai.
Recursive query maangti hai
final finished answer ("Main wait karoonga").
Iterative query return karta hai
ek referral — next server ka address jo poochha jaaye.
Authoritative answer hai
woh final true reply jo us server se aati hai jo actually record store karta hai.
Ek record ki form hoti hai
(name, type, value, TTL).
TTL ka matlab hai
kitne seconds ek cached record fresh rehta hai dobara look-up se pehle.
Cache hai
recent answers ki short-term memory, TTL tak valid, jo tree walk skip karti hai.
MX priority mein preferred server ka hota hai
sabse chhota number (pehle try hota hai).

Main topic par wapas: parent note. Related foundations: IP Addressing — IPv4 vs IPv6 · Caching and TTL · HTTP and the Web request lifecycle.