Tony CantaveMy CompTIA Network+ Notes on Troubleshooting DNS and DHCP
By Tony Cantave ·
When someone tells me their computer "has no internet", I have learned not to start with the router or the cable. Most of the time the problem is one of two quiet services that everyone forgets about until they break: DHCP, which hands out addresses, and DNS, which turns names into addresses. Studying for CompTIA Network+ gave me the theory. Running my own home lab gave me the habit of checking them in a fixed order.
These are my notes, written as the order of checks I actually use.
Quick refresher: what each service does
DHCP gives a device its IP address, subnet mask, default gateway and DNS server addresses. It runs over UDP, with the server listening on port 67 and the client on port 68. The exchange has four steps that Network+ calls DORA:
- Discover: the client broadcasts "is there a DHCP server out there?"
- Offer: a server answers with an available address.
- Request: the client asks for that address.
- Acknowledge: the server confirms, and the lease starts.
DNS resolves names like example.com to IP addresses. Queries normally use UDP port 53, and TCP port 53 is used for larger responses and zone transfers. Answers are cached for the length of their TTL, which matters a lot when you are troubleshooting, because an old wrong answer can stick around after you fix the record.
Step 1: Look at the address the device actually has
On Windows:
ipconfig /allOn Linux:
ip addr
ip route
cat /etc/resolv.confI look for four things: the IP address, the subnet mask, the default gateway and the DNS servers. The single most useful clue is an address that starts with 169.254. That is APIPA, an automatic private address Windows assigns itself when it cannot reach a DHCP server. If you see it, DNS is not your problem yet. The device never got a lease.
Step 2: If there is no lease, work the DHCP side
Common causes I keep in my notes:
- The client cannot reach the server. DHCP Discover is a broadcast, and routers do not forward broadcasts by default. If the server lives on another subnet, the router needs a DHCP relay (often called an IP helper) configured.
- The scope is exhausted. Every address in the pool is leased. This shows up on guest networks with long lease times and lots of phones passing through. Shorter leases or a bigger scope fix it.
- A rogue DHCP server. A consumer router plugged into the wrong port starts handing out its own addresses, often in a different range like 192.168.0.x. If clients get an unexpected gateway, suspect this first. DHCP snooping on managed switches is the real defense.
- Wrong VLAN. The port is in a VLAN with no DHCP service at all.
To ask for a fresh lease on Windows:
ipconfig /release
ipconfig /renewIf renew hangs and you fall back to 169.254 again, the problem is between the client and the server, not on the client.
Step 3: If the address looks right, separate connectivity from name resolution
This is the test that saves the most time. Ping a known IP address first, then a name:
ping 1.1.1.1
ping example.comIf the IP works but the name fails, routing is fine and you have a DNS problem. If both fail, go back to the gateway and the route before touching DNS.
Step 4: Work the DNS side
First, ask the configured DNS server directly:
nslookup example.comThen ask a different public resolver to compare:
nslookup example.com 1.1.1.1On Linux, dig example.com gives more detail, including the TTL on the answer.
How I read the results:
- Configured server times out, public server answers: the DNS server the device was given is down or unreachable. Check which DNS address DHCP is handing out, since a typo in the DHCP options breaks every client at once.
- Both answer, but with different addresses: either a record was changed recently and one resolver still has the old answer cached, or an internal DNS server has its own version of the zone. Wait out the TTL or check the internal record.
- Everything resolves, but one machine still fails: clear the local cache with ipconfig /flushdns and check the hosts file for an old manual entry.
The pattern behind the notes
The exam questions on this topic feel like memorization, but the real lesson is order. Address first, then lease, then raw connectivity, then names. Each step rules out a whole layer, so you never end up changing DNS settings on a machine that never had an address in the first place.
I picked up the same habit years ago working in delivery and logistics operations and in manufacturing: when something stops moving, you check the steps in sequence instead of guessing at the most interesting one. Networks reward that same discipline.
If you are studying for Network+, my suggestion is to break your own home lab on purpose. Turn off the DHCP service, point a client at a DNS server that does not exist, set a lease time of two minutes and fill the scope. Watching each failure happen once makes the exam questions much easier to read, and makes real troubleshooting much faster.