DNS is the "phone book" of the Internet. It translates human-readable domain names (like www.google.com) into IP addresses (like 142.250.80.46) that computers use to communicate.
DNS Hierarchy
Root DNS Servers: The top of the DNS hierarchy. There are 13 root server clusters (labeled A through M) worldwide. They know the addresses of all TLD servers.
TLD (Top-Level Domain) Servers: Manage domains like .com, .org, .net, .edu, .uk, .in. They know the addresses of authoritative name servers.
Authoritative Name Servers: Hold the actual DNS records for specific domains. Managed by domain owners or their DNS providers.
Recursive Resolver: The DNS server your ISP or organization provides. It queries other DNS servers on your behalf and caches results.
DNS Resolution Process
User types www.example.com in browser
Browser checks its local DNS cache
If not cached, OS checks its hosts file (/etc/hosts)
If not found, query goes to the Recursive Resolver (ISP's DNS)
Resolver checks its cache; if not found, queries a Root Server
Root server responds with the address of the .com TLD server
Resolver queries the .com TLD server, which responds with the authoritative name server for example.com
Resolver queries the authoritative server, which returns the IP address
Resolver caches the result and returns it to the client
Browser connects to the IP address
DNS Record Types
Record Type
Purpose
Example
A
Maps domain to IPv4 address
example.com -> 93.184.216.34
AAAA
Maps domain to IPv6 address
example.com -> 2606:2800:220:1:248:1893:25c8:1946
CNAME
Alias - maps one domain to another
www.example.com -> example.com
MX
Mail exchange - specifies mail servers
example.com -> mail.example.com (priority 10)
NS
Name server - specifies authoritative DNS servers
example.com -> ns1.example.com
PTR
Reverse DNS - maps IP to domain name
93.184.216.34 -> example.com
TXT
Text records - SPF, DKIM, domain verification
v=spf1 include:_spf.google.com ~all
SOA
Start of Authority - zone information
Primary NS, admin email, serial number, TTL
SRV
Service location records
_http._tcp.example.com -> server:port
DHCP - Dynamic Host Configuration Protocol
DHCP automatically assigns IP addresses and other network configuration (subnet mask, default gateway, DNS servers) to devices on a network. Without DHCP, every device would need to be manually configured.
DHCP DORA Process
DHCP uses a 4-step process called DORA to assign IP addresses:
Discover: Client broadcasts a DHCPDISCOVER message to find available DHCP servers. Source: 0.0.0.0, Destination: 255.255.255.255
Offer: DHCP server responds with a DHCPOFFER containing an available IP address, subnet mask, lease duration, and other options.
Request: Client broadcasts a DHCPREQUEST to accept the offered IP address (and inform other DHCP servers it's declining their offers).
Acknowledge: DHCP server sends a DHCPACK confirming the IP address assignment. The client can now use the IP address.
DHCP Lease and Static vs Dynamic IP
Feature
Static IP
Dynamic IP (DHCP)
Assignment
Manually configured
Automatically assigned by DHCP
Changes
Never changes
May change on lease renewal
Management
Complex (manual tracking)
Easy (centralized)
Use Case
Servers, printers, routers
Workstations, laptops, phones
Cost
Higher (ISP charges)
Lower
DNS packet-flow walkthrough
DNS packet-flow walkthrough
Client device
-> local network interface
-> default gateway or switch
-> routing/security decision
-> destination service
For DNS, explain each hop by naming the address, protocol, port, and decision made at that layer.
Separate DHCP Address Assignment from DNS Resolution
Separate DHCP Address Assignment from DNS Resolution
DHCP: Discover -> Offer -> Request -> Acknowledge
Lease result: address 10.20.0.42/24, gateway 10.20.0.1, DNS server 10.20.0.53
DNS: client asks 10.20.0.53 for api.example A/AAAA records
The DHCP lease supplies resolver settings; DNS then maps names to addresses.
A valid lease does not prove DNS works, and a cached DNS answer does not prove the current lease is healthy.
Before you move on
DNS DHCP Domain Resolution IP Assignment Mastery Check
4 checks
DNS is the "phone book" of the Internet.
It translates human-readable domain names (like www.google.com) into IP addresses (like 142.250.80.46) that computers use to communicate.
DHCP automatically assigns IP addresses and other network configuration (subnet mask, default gateway, DNS servers) to devices on a network.
Without DHCP, every device would need to be manually configured.
DNS and DHCP Boundary
Caching hides configuration changes
A corrected DNS record or lease option may not appear until caches or leases expire. Check authoritative data, TTL, resolver cache, and client lease state separately.
Resolvers and clients cache records according to TTL, and some retain negative results as well. Users may query different recursive resolvers or follow different delegation paths.
Discover shows whether the client broadcasts a request. Offer proves a DHCP server or relay heard it and proposed configuration.
NXDOMAIN is a valid DNS response saying the queried name does not exist according to the responding DNS hierarchy. A timeout means no usable response arrived, which points toward connectivity, firewall, resolver, or server availability.