What is Policy Base Routing (PBR) and How to Configure It?
What is Policy Base Routing? Policy Based Routing (PBR) is a network routing technique used to specify the…
DHCP and DNS are two completely different services that get confused because both are essential, both are usually running on the same router, and both cause “the internet is down” when they fail.
google.com into IP addresses so your device can find things on it.A device with no DHCP has no address and cannot communicate at all. A device with no DNS has a working connection but cannot resolve any name, ping 8.8.8.8 succeeds while ping google.com fails. That difference is the fastest way to tell them apart when troubleshooting.
| DHCP | DNS | |
|---|---|---|
| Full name | Dynamic Host Configuration Protocol | Domain Name System |
| Job | Assigns IP configuration to clients | Resolves names to IP addresses |
| When it runs | When a device joins the network, then on lease renewal | Every time a name is looked up |
| Transport | UDP 67 (server), UDP 68 (client) | UDP 53 and TCP 53; DoT 853; DoH 443 |
| Scope | Local network | Global, hierarchical |
| RFC | 2131 | 1034 / 1035 |
| Symptom when broken | 169.254.x.x address, no connectivity at all | IP addresses work, names do not |
The exchange has four steps, remembered as DORA:
255.255.255.255 asking if any DHCP server is out there.The client receives more than just an address:
At 50% of the lease time (T1) the client tries to renew directly with its server. At 87.5% (T2) it broadcasts to any server. If the lease expires entirely, the client must start over with Discover.
DHCP Discover is a broadcast, and routers do not forward broadcasts. So a client in VLAN 20 cannot reach a DHCP server in VLAN 10 without help. A DHCP relay agent (Cisco’s ip helper-address) on the router’s VLAN interface converts the broadcast into a unicast to the server:
Router(config)# interface Vlan20
Router(config-if)# ip helper-address 10.10.10.5Forgetting this on a new VLAN is one of the most common reasons a freshly configured VLAN “has no internet”.
Resolving www.example.com walks down a hierarchy:
hosts file..com nameservers.example.com.| Type | Returns |
|---|---|
| A | An IPv4 address |
| AAAA | An IPv6 address |
| CNAME | An alias pointing to another name |
| MX | Mail servers for the domain |
| NS | Authoritative nameservers |
| TXT | Arbitrary text, SPF, DKIM, domain verification |
| PTR | Reverse lookup: address to name |
| SOA | Zone authority and timing parameters |
They are separate protocols, but they meet in three places:
ping fileserver resolves as fileserver.company.local.| Symptom | Cause | What to check |
|---|---|---|
Address is 169.254.x.x | DHCP failed, this is APIPA | DHCP server running? Pool exhausted? Missing ip helper-address? |
| No IP address at all | DHCP, or a physical problem | Link lights, cable, VLAN assignment on the switch port |
ping 8.8.8.8 works, ping google.com fails | DNS | Resolver reachable? Try nslookup google.com 8.8.8.8 |
| Some sites work, others do not | DNS caching or a stale record | Flush the cache; compare against a public resolver |
| IP conflict warning | Static address inside the DHCP pool | Move statics outside the pool, or use reservations |
| Everything slow to start, then fine | DNS timeout falling back to a secondary | Check the primary resolver is actually answering |
# Windows
ipconfig /all # current address, gateway, DNS servers, lease times
ipconfig /release # drop the lease
ipconfig /renew # request a new one
ipconfig /flushdns # clear the resolver cache
nslookup google.com
nslookup google.com 8.8.8.8 # bypass the configured resolver
# Linux / macOS
ip addr
dhclient -r && dhclient # release and renew
dig google.com
dig @8.8.8.8 google.com
resolvectl status # systemd resolver statenslookup google.com 8.8.8.8 is the single most useful test: if that works but plain nslookup google.com does not, your configured resolver is the problem, not DNS as a whole.
Both protocols were designed without authentication and both are attacked accordingly.
Yes. Configure the address and resolver statically and DNS works fine. DHCP is just the usual way those settings get delivered.
Yes. Devices get addresses and can communicate by IP. They simply cannot resolve names, so browsing does not work.
DNS, but you set it in the DHCP server’s configuration (usually the router) so every client receives it, or per-device if you only want to change one machine.
Typically both. It runs a DHCP server for the LAN and a DNS forwarder that relays queries to your ISP’s resolvers or whichever ones you configure.
The client attempts renewal at 50% and again at 87.5% of the lease. If both fail and the lease runs out, it releases the address and restarts the DORA process. If no server answers, it self-assigns a 169.254.x.x address.
Redundancy. If the primary does not answer within the timeout, the client tries the secondary. A slow or unreachable primary makes everything feel sluggish even though it eventually works, which is why an unresponsive primary is worth fixing rather than tolerating.