Appearance
What is DHCP? How devices get their IP addresses
DHCP is why you've never typed an IP address to join Wi-Fi: every network runs a small service that leases each arriving device an address, tells it where the gateway and DNS are, and reclaims the address when the lease lapses. It's also the answer to a family of everyday mysteries — why your public IP changes, why the printer "moved" overnight, and what that useless 169.254 address means. Same protocol, every time.
Maintained by the ipconfig.io team · Reviewed 1 July 2026
The lease, in four packets
A device joining a network knows nothing — not even who to ask. So it shouts:
| Step | Who → Who | Message |
|---|---|---|
| Discover | Device → everyone | "Any DHCP server here? I need an address" |
| Offer | Server → device | "How about 192.168.1.23, lease 24h, gateway .1, DNS here" |
| Request | Device → server | "I'll take it" |
| Acknowledge | Server → device | "Confirmed — it's yours until the lease runs out" |
The device renews as the clock runs down (typically at half-life), usually keeping the same address for as long as it stays around. Leases are why networks self-heal — addresses of departed devices return to the pool automatically.
The part people miss: it's happening twice
Your router runs the DHCP server for the LAN, leasing private addresses to your devices. Meanwhile your router is itself a DHCP client — leasing its public address from your ISP's server. That upstream lease is exactly why your public IP rotates (and how to nudge it): reconnect after the lease lapses and you may draw a different address from the ISP's pool.
bash
curl ipconfig.io # the ISP's lease to your router
ip addr # your router's lease to this device (ipconfig on Windows)The two settings worth knowing
Reservations. Devices that get found by address — printer, NAS, the Pi behind a port forward — shouldn't drift when leases recycle. A DHCP reservation (router settings, keyed on the device's MAC) pins the address while keeping the device on plain automatic config. Prefer it over configuring static addresses on devices themselves: the router stays the single source of truth, and nothing collides.
The failure address. 169.254.x.x means "I asked, nobody answered" — the device self-assigned a link-local address to keep the LAN limping, but it has no gateway and no DNS, so no internet. Treat it as a diagnostic: DHCP server down, cable/Wi-Fi problem, or a full address pool. (Its IPv6 cousin fe80::… is normal and always present, by contrast — IPv6 does things differently, often configuring addresses without DHCP at all.)
Frequently asked questions
What is DHCP? The protocol that automatically leases devices their IP address plus gateway and DNS — on your LAN (from the router) and on the ISP side (to your router).
How does the lease work? Discover → Offer → Request → Acknowledge, with a timer; renewals keep it, lapses recycle it.
What's a 169.254 address? DHCP failure — self-assigned, LAN-only, no internet. Diagnose the server or the link.
What's a reservation? A router rule pinning one device (by MAC) to one address — automatic config with a stable result.
Next steps
- Static vs dynamic IP addresses — the ISP-side lease and your options around it.
- Public vs private IP — the two address spaces DHCP is populating.
- What is my router's IP? — finding the machine handing out the leases.