7.2 DNS & DHCP
Key Takeaways
- DNS translates human-readable names to IP addresses; a typical recursive lookup asks root → TLD → authoritative name servers until an A/AAAA (or other) answer returns
- Common record types: A (IPv4), AAAA (IPv6), CNAME (alias), MX (mail), NS (name server), PTR (reverse)
- DHCP automates host IP configuration using DORA: Discover, Offer, Request, Acknowledge
- DHCP commonly uses UDP 67 (server) and 68 (client); DNS commonly uses UDP/TCP 53
- Without DHCP a host may lack an address/gateway/DNS settings; without DNS users cannot resolve names even when IP connectivity works
Two services make modern networks usable for humans: DNS (Domain Name System) turns names into addresses, and DHCP (Dynamic Host Configuration Protocol) hands out IP settings so devices can join a network without manual typing. The Cyber Test expects you to know the resolution path, major record types, the DHCP DORA exchange, and the ports involved.
DNS: Names That Machines Can Use
People remember recruiting.af.mil far better than a raw IPv4 or IPv6 address. DNS is the distributed database and protocol that maps names to resource records. When your browser or tool asks "what is the IP for this hostname?", a resolver (usually your OS, talking to a recursive DNS server) finds the answer.
Recursive Resolution Steps (Typical Path)
Assume a client needs the IPv4 address of www.example.com and has no useful cache:
- Stub resolver → recursive server: The client queries its configured DNS server (often from DHCP), usually over UDP port 53.
- Root hint: If the recursive server does not already know, it asks a root name server: "Who handles
.com?" - TLD referral: A root server responds with a referral to the
.comTLD (top-level domain) name servers. - Authoritative referral: The recursive server asks a
.comTLD server: "Who is authoritative forexample.com?" and receives NS records (and glue addresses) for that zone. - Authoritative answer: The recursive server queries an authoritative server for
example.comand receives the A record forwww.example.com(or a CNAME chain that eventually ends in an A/AAAA). - Response to client: The recursive server returns the answer to the client and typically caches it for the record's TTL (time to live).
On later lookups within the TTL, steps 2–5 are skipped — cache hits are why the Internet feels fast after the first resolution.
Iterative vs Recursive (Exam Language)
- Recursive query: "Please get me the final answer" — what clients usually send to their resolver.
- Iterative query: "Tell me the next best referral" — how recursive servers typically walk the hierarchy with root/TLD/authoritative servers.
You do not need ISP internals, but you do need the chain: client → recursive → root → TLD → authoritative → answer.
Important DNS Record Types
| Type | Purpose |
|---|---|
| A | Maps a name to an IPv4 address |
| AAAA | Maps a name to an IPv6 address |
| CNAME | Alias — one name points to another name |
| MX | Mail exchanger — where email for a domain should be delivered |
| NS | Delegates a zone to name servers |
| PTR | Reverse lookup — IP to name (used in reverse zones) |
| TXT | Arbitrary text (SPF, verification strings, etc.) |
Practical Notes
- A hostname can have both A and AAAA records (dual-stack).
- CNAME targets are names, not "final IPs" by themselves — resolution continues until an address record appears.
- MX records point to hostnames that themselves need A/AAAA records.
- Reverse DNS (PTR) is separate from forward DNS; not every forward name has a matching PTR.
DNS and Transport
Ordinary queries use UDP/53. If the response is too large or for zone transfers (AXFR/IXFR between name servers), DNS may use TCP/53. Security tooling that "allows DNS" must often allow both, or large answers break.
Failure Modes You Should Recognize
- Wrong DNS server / blocked 53: Pings to an IP work; browsing by name fails.
- Stale cache: An old A record remains until TTL expires after a server moves.
- NXDOMAIN: Authoritative answer says the name does not exist.
- ServFail: Resolver error — upstream timeout, misconfiguration, or validation failure.
DHCP: Automatic Host Configuration
Manually assigning IP address, subnet mask, default gateway, and DNS servers to every laptop does not scale. DHCP leases that configuration from a server.
What a Typical Lease Includes
- IPv4 address
- Subnet mask (or prefix length)
- Default gateway (router)
- DNS server addresses
- Lease duration and renewal timers
- Optionally: domain name, NTP servers, and other options
DORA — The Four-Step Dance
Memorize the acronym DORA:
- Discover — The client (usually with address
0.0.0.0) broadcasts a DHCPDISCOVER: "Is any DHCP server out there?" Source port 68, destination 67, often to the broadcast address. - Offer — A DHCP server replies with a DHCPOFFER proposing an IP address and options.
- Request — The client broadcasts (or unicasts, depending on state) a DHCPREQUEST accepting a specific offer — important when multiple servers offered.
- Acknowledge — The chosen server sends DHCPACK confirming the lease. The client configures its interface and can communicate on the network.
Ports to lock in: UDP 67 = server, UDP 68 = client.
Lease Lifecycle
- Mid-lease, the client renews (typically unicast to the leasing server).
- If renewal fails, it may rebinding by broadcasting again before the lease expires.
- When finished, a polite client can DHCPRELEASE the address.
- If no server answers, some OSes fall back to APIPA (169.254.0.0/16 link-local) — a clue the host never got a real DHCP lease.
DHCP Relay (Why Servers Can Sit Off-Subnet)
DHCP Discover is a broadcast. Routers do not forward broadcasts by default. A DHCP relay (IP helper) on the local router catches the Discover and unicasts it to a central DHCP server on another subnet, preserving enough client info for a correct offer. Conceptually: relays let one DHCP server serve many VLANs.
DNS and DHCP Working Together
On a healthy LAN:
- Host boots and completes DORA.
- Lease includes a DNS server address (and often a default domain).
- User opens a URL; the stub resolver asks that DNS server.
- Name becomes an IP; TCP/UDP sessions proceed to the destination.
Break either service and symptoms diverge:
| Symptom | Likely culprit |
|---|---|
| No IP / APIPA address / "Unidentified network" | DHCP |
| Has IP and gateway, but names fail | DNS |
| Names work for some domains only | Partial DNS/cache/filtering issue |
| IP connectivity to known addresses works | Routing/IP OK; focus on name services |
Security Angles (Light Touch for CT)
You are not studying full red-team tradecraft here, but the aptitude exam may touch risks:
- Rogue DHCP: An unauthorized server offers bad gateways (traffic interception).
- DNS spoofing / cache poisoning: Wrong answers redirect users to malicious IPs.
- Cleartext queries: Traditional DNS is not encrypted (DoH/DoT exist but are beyond core CT depth).
Defenses conceptually: authorize DHCP servers, monitor for extra offers, validate DNS where policy requires, and restrict who can reconfigure resolver settings.
Exam Drill Points
Be ready to:
- Order the DNS hierarchy walk (root → TLD → authoritative).
- Expand DORA and assign each step's purpose.
- Match 67/68 to DHCP and 53 to DNS.
- Distinguish A vs AAAA vs MX vs CNAME.
- Diagnose "IP works, web names don't" as DNS-centric.
Master these two services and you unlock half of practical networking troubleshooting — and a large slice of Networking-domain Cyber Test items.
In a typical recursive DNS lookup for www.example.com with an empty cache, which server type is queried first by the recursive resolver after the client's initial request?
What is the correct order of the DHCP DORA process?
Which DNS record type maps a hostname to an IPv6 address?
A workstation received a valid IP address, subnet mask, and default gateway, but cannot resolve hostnames. Which service is the most likely problem?