DHCP — the Dynamic Host Configuration Protocol — is what hands your phone an IP address seconds after it joins Wi-Fi. Before DHCP existed, every device on a network needed a statically-assigned IP, a gateway, a netmask, and a list of DNS servers, hand-configured. DHCP automates all of that.
The four-step handshake (DORA)
Mnemonic: Discover, Offer, Request, Acknowledge.
- Discover. Your device broadcasts a DHCPDISCOVER packet to
255.255.255.255— "is there a DHCP server out there? I need an IP." - Offer. The DHCP server (usually your router) responds with a DHCPOFFER: "here's an IP from my pool, here's the gateway, here are the DNS servers, the lease is valid for 24 hours."
- Request. Your device sends DHCPREQUEST formally accepting the offered IP. The accept is broadcast so any other DHCP servers on the network know it's taken.
- Acknowledge. Server replies DHCPACK confirming the assignment. Device configures the interface and starts using the IP.
Lease lifecycle
A DHCP lease isn't forever. Halfway through the lease period (the "T1" timer), your device sends DHCPREQUEST to the same server asking to renew. If the server replies, the lease extends. If it doesn't reply by 87.5% of the lease (the "T2" timer), the device broadcasts looking for any DHCP server willing to extend the lease. If even that fails, the device eventually drops back to DISCOVER.
For sticky IPs, most home routers and DHCP servers support reservations keyed on MAC address: "device with MAC 3c:5a:b4:00:00:00 always gets 192.168.1.50." Cleaner than configuring static IPs on each device.
IPv6 alternatives
- SLAAC (Stateless Address Auto-Configuration). Router sends a Router Advertisement; the device generates its own IPv6 by combining the advertised prefix with a self-chosen interface identifier. No DHCP server required.
- DHCPv6. Stateful equivalent to IPv4 DHCP. Some networks want a central server tracking every assignment.
- SLAAC + DHCPv6 hybrid. Device gets its address via SLAAC but pulls DNS and other config from DHCPv6. The most common setup in modern enterprise.
When DHCP misbehaves
- Address conflicts. Two devices end up on the same IP. Usually because someone hard-coded a static IP inside the DHCP pool. Modern DHCP servers detect this with ARP probes and skip conflicting addresses.
- Rogue DHCP servers. Anyone on the LAN can run a DHCP server; the fastest reply wins. Common attack vector. DHCP snooping on managed switches mitigates.
- Exhausted pool. Lease pool is too small for the number of devices. Symptom: some devices fail to get an IP. Fix: shorten lease times or grow the pool.
- Stuck APIPA. When DHCP fails entirely on Windows / macOS, the device falls back to an auto-assigned 169.254.x.x address. If you see one of those on your interface, DHCP is broken.
If you're trying to figure out your assigned address, the home page shows your public IP — but for the local one, check your router admin or your OS network settings. Local IPs are private (RFC 1918) — see the glossary entry.
