3. DNS and DHCP¶
Two services quietly handle almost everything about getting online: one gives your device an address, the other turns names into addresses.
DHCP: getting an address automatically¶
Without DHCP, every device would need a hand-typed IP address — unworkable for a network with more than a few machines. DHCP automates it through a four-step handshake, nicknamed DORA:
- Discover — the device broadcasts "is anyone out there with an address for me?"
- Offer — a DHCP server replies with an available address.
- Request — the device says "I'll take that one."
- Acknowledge — the server confirms, and the device starts using it.
This address is leased, not permanent — it expires after a set time and gets renewed or reassigned.
DNS: turning names into addresses¶
Computers route traffic by IP address, not by name — DNS is the lookup that makes vhslab.online resolve to an actual address, the same way a phone's contacts app turns a name into a number before dialing.
A few record types you'll see constantly:
| Record | Holds |
|---|---|
A |
A domain's IPv4 address |
AAAA |
A domain's IPv6 address |
CNAME |
An alias pointing to another domain name |
MX |
Which mail server handles email for a domain |
Try it
Trace what happens, step by step, when you type vhslab.online into a browser: what has to happen with DNS before your computer even knows where to send the first byte of the request?
Tip
If a whole network can reach some sites by IP address but not by name, that's almost always a DNS problem, not a connectivity problem — the lab itself hit exactly this (its ISP blocks port 53, so pve1 runs a DoH proxy to work around it).
Play it
Try the DNS and DHCP Lab for hands-on practice with the DORA handshake and DNS record lookups.
Watch along
From the CompTIA A+ 220-1201 Full Course:
- DNS and email security (1:47:14) — skip ahead past the email security portion
- DHCP configuration (1:53:22)