Application Layer · Computer Networks

Domain Name Space (DNS)

Watch lectures
SVGVector Architecture Diagram (SVG)
COMPUTER NETWORKS · Module 5 · Application Layer★ High PriorityIT Sem 6 · Code 100602DNS & Dynamic DNSMNEMONICR-T-A: a lookup goes Root → TLD → Authoritative (top to bottom of the tree).DNS = the Internet's phone book: name in, IP address out.Core BreakdownPurposeMaps human-readable domain names to IP addresses (and IP back to names).Client-server application protocol: queries/replies use UDP port 53 (TCP 53 for zone transfers).Name SpaceHierarchical inverted tree, up to 128 levels (0 to 127); the root is at the top with a null label.Label ≤ 63 characters; complete domain name ≤ 255 characters.FQDN vs PQDNFQDN = full name ending with a dot (null label), e.g. challenger.atc.fhda.edu.PQDN = partial name; the resolver adds a suffix to turn it into an FQDN.HierarchyRoot → TLD (generic: .com .org .edu, country: .in .uk) → second-level domains → hosts.Domain = a whole subtree. Zone = the part of the tree one server is responsible for.DNS ServersRoot server knows the TLD servers; TLD server knows the authoritative servers.Authoritative server (primary + secondary) holds the real records. Resolver caches replies for the TTL.ResolutionRecursive: the resolver does all the work and returns the final answer to the client.Iterative: each server returns the answer or a referral ('ask that server next').Record TypesA = IPv4 · AAAA = IPv6 · NS = name server · CNAME = alias · MX = mail exchangerPTR = reverse lookup (IP → name) · SOA = start of authority for the zoneDDNSDynamic DNS updates name → IP mappings automatically when a host's address changes (e.g. DHCP).Update goes to the primary server; secondary servers are notified and copy the change.Diagram: DNS Resolution (sequence)ClientLocal DNSRootTLD (.com)Authoritative1 www.example.com?2 www.example.com?3 ask .com TLD4 www.example.com?5 ask Authoritative6 www.example.com?7 IP address8 IP addressRecursive: Client → Local DNS · Iterative: Local DNS → Root / TLD / Auth. (root) → .com (TLD) → example.com (zone) → www (host)⚠️ Exam Traps & Viva Favorites① UDP or TCP?Queries and replies use UDP port 53.TCP 53 is used for zone transfers andreplies that are too large for UDP.② Recursive vs iterative?Client → local resolver = recursive.Resolver → root / TLD / auth = iterative(each replies with a referral).③ What problem does DDNS fix?Static DNS can't track hosts whose IPchanges (DHCP). DDNS updates recordsautomatically and notifies secondaries.Tip: Root → TLD → AuthoritativeMaster Revision Table(learn it row by row!)RecordMaps / MeaningExampleUsed ForPitfallAname → IPv4 addressexample.com → 192.0.2.10Forward lookupIPv4 only, not IPv6AAAAname → IPv6 addressexample.com → 2001:db8::10Forward lookupQuad-A = 128-bit addressNSzone → name serverexample.com → ns1.example.comDelegationPoints to a name, not an IPCNAMEalias → canonical namewww.example.com → example.comAliasingAlias only; target is a nameMXdomain → mail serverexample.com → mail.example.com (pref 10)Email routingLower preference tried firstPTRIP address → name10.2.0.192.in-addr.arpa → host nameReverse lookupReverse zone: in-addr.arpaQUICK FACTSDNS: UDP/TCP port 53 · Label ≤ 63 chars · FQDN ≤ 255 chars · Tree depth ≤ 128 levelsCache lifetime = TTL (set by the authoritative server) · Zone transfer uses TCPReverse lookup domain for IPv4: in-addr.arpaVERIFIED★ Golden rule: DNS = Root → TLD → Authoritative; answers are cached for the TTL.

Domain Name System (DNS)


1. Concept and Purpose of DNS

Computers and routers route packets using numerical IP addresses (e.g., 142.250.190.46), but humans remember alphanumeric names (e.g., www.google.com).

The Domain Name System (DNS) (RFC 1034 / 1035) is a hierarchical, distributed database system that acts as the "phonebook of the Internet," mapping human-readable hostnames to numerical IP addresses.

MermaidDiagram
Rendering diagram…

2. Hierarchical Domain Name Space

The domain namespace is structured as an inverted tree with the Root at the top:

MermaidDiagram
Rendering diagram…

Hierarchy Levels:

  1. Root Domain (.): Represented by a null string or dot at the top of the tree. Supervised by ICANN and operated across 13 worldwide root server clusters (A through M).
  2. Top-Level Domains (TLD):
    • Generic TLDs (gTLD): .com (commercial), .org (non-profit), .edu (education), .gov (government).
    • Country-Code TLDs (ccTLD): Two-letter country codes: .in (India), .uk (United Kingdom), .us (United States).
  3. Second-Level Domains: Registered by individuals or corporations (e.g., google.com, wikipedia.org).
  4. Subdomains: Created by the domain owner to organize internal services (e.g., mail.google.com, cs.stanford.edu).
  • FQDN (Fully Qualified Domain Name): Absolute name terminated with a trailing dot (www.example.com.).
  • PQDN (Partially Qualified Domain Name): Relative name without trailing dot (www).

3. The DNS Resolution Process

DNS resolution combines Recursive and Iterative queries:

MermaidDiagram
Rendering diagram…
  1. Recursive Query (Client to Local DNS Resolver): The client demands that the local resolver do all the legwork to resolve the name or return an error.
  2. Iterative Query (Local Resolver to Hierarchy Servers): The server contacted responds with the best referral it has ("I don't know the exact IP, but ask this next server").
  3. Caching & TTL: The local resolver caches the resolved IP for the duration specified in the TTL (Time to Live) field, instantly serving future requests without querying the Internet.

4. DNS Resource Record (RR) Types

The DNS database stores entries called Resource Records (RRs):

Record Type Full Name Purpose Example
A Address Record Maps hostname to 32-bit IPv4 address example.com. IN A 93.184.216.34
AAAA IPv6 Address Maps hostname to 128-bit IPv6 address example.com. IN AAAA 2606:2800:220:1::
CNAME Canonical Name Creates an alias pointing to the true name www.example.com. IN CNAME example.com.
MX Mail Exchange Directs incoming email to mail servers example.com. IN MX 10 mail.example.com.
NS Name Server Delegates a DNS zone to an authoritative server example.com. IN NS ns1.example.com.
PTR Pointer Record Reverse DNS: Maps IP address to Hostname 34.216.184.93.in-addr.arpa IN PTR example.com.
SOA Start of Authority Stores zone administrative metadata and serial Primary NS, Admin email, Refresh timers
TXT Text Record Human-readable text; SPF/DKIM email verification v=spf1 include:_spf.google.com ~all

5. Transport Protocol Usage: UDP vs. TCP on Port 53

DNS uses Well-Known Port 53 on both UDP and TCP:

  • UDP Port 53: Used for standard client queries and responses. Standard DNS messages are under 512 bytes512\text{ bytes}; UDP avoids connection handshake latency.
  • TCP Port 53: Used for Zone Transfers (replicating entire DNS databases between primary and secondary name servers) and responses exceeding 512 bytes512\text{ bytes} (or DNSSEC) requiring reliable transmission.

Frequently Asked Questions

QDifferentiate Recursive and Iterative DNS queries.

In a Recursive query, the client places the entire resolution burden on the queried server, which must return either the resolved IP or an error. In an Iterative query, the contacted server returns the IP of the next authoritative server down the chain if it cannot answer directly.

QWhen does DNS use TCP instead of UDP?

For Zone Transfers between primary and secondary DNS servers to ensure database replication integrity, and when query responses exceed the 512-byte UDP packet limit (e.g., DNSSEC).

QWhat is Reverse DNS lookup and which record type performs it?

Reverse DNS resolves a known IP address back into its domain hostname using PTR (Pointer) records inside the special in-addr.arpa domain.

QWhat is the difference between an FQDN and a PQDN?

An FQDN is an absolute name ending with a trailing dot (www.example.com.) that specifies the full path from the root. A PQDN is a relative name without the trailing dot (www) that the resolver completes using a default domain suffix.

QWhat role does TTL play in DNS caching?

TTL (Time to Live) tells resolvers how long they may cache a record. Within that time, repeat queries are answered from the cache without contacting upstream servers. A long TTL reduces load but slows propagation of changes.

AI LearningWeb Platform

Coursify — Personal AI Course Generator

Struggling with a difficult subject or concept? Turn any engineering topic into a structured course with interactive lessons, quizzes, and research-backed explanations.

← All Computer Networks modules