What Is DHCP? How Your Devices Get IP Addresses Automatically
DHCP (Dynamic Host Configuration Protocol) is the protocol that automatically assigns IP addresses and network configuration to devices when they connect to a network. Every time you connect your phone to Wi-Fi, plug in an Ethernet cable, or boot up a computer, DHCP handles the behind-the-scenes work of giving your device an IP address, subnet mask, default gateway, and DNS server addresses without any manual configuration. It’s the reason you don’t have to manually type in network settings every time you join a network.
The DHCP Process (DORA)
DHCP follows a four-step process that networking people remember as DORA:
Discover: Your device broadcasts “I need an IP address” to the entire local network (since it doesn’t know the DHCP server’s address yet). This broadcast goes to 255.255.255.255 on port 67.
Offer: The DHCP server responds with an offer: “Here, you can use 192.168.1.50 with subnet mask 255.255.255.0, gateway 192.168.1.1, and DNS servers 1.1.1.1 and 1.0.0.1. This lease is good for 24 hours.”
Request: Your device broadcasts back: “I’ll take that offer from [server address].” This is broadcast (not unicast) so that if multiple DHCP servers made offers, the others know their offer was declined.
Acknowledge: The DHCP server confirms: “Done. That address is yours for 24 hours.” The server records the lease in its table and the device configures its network interface.
The entire DORA process takes milliseconds. It happens so fast and so transparently that most people never realize it’s occurring.
What DHCP Configures
Beyond just the IP address, DHCP provides:
| Option | Description |
|---|---|
| IP address | The host address for the device |
| Subnet mask | Defines the network boundary |
| Default gateway | Router address for internet access |
| DNS servers | Name resolution servers |
| Lease duration | How long the address is valid |
| Domain name | Network’s domain suffix |
| NTP server | Time synchronization server |
| WINS server | Legacy Windows name resolution |
These are specified as DHCP options (defined in RFC 2132). The most commonly used are options 1 (subnet mask), 3 (router/gateway), 6 (DNS servers), and 51 (lease time).
DHCP Lease Lifecycle
Your IP address isn’t permanent. It’s a lease with an expiration date.
At 50% of lease time: Your device tries to renew the lease with the same DHCP server. If successful, the timer resets.
At 87.5% of lease time: If renewal failed, the device broadcasts a renewal request to any DHCP server on the network (rebinding).
At 100% of lease time: If all renewal attempts failed, the device releases the address and starts the DORA process again from scratch.
In practice, most devices renew successfully at the 50% mark, so you keep the same IP address for long periods even though it’s technically “dynamic.”
DHCP Reservations
You can tell your DHCP server to always assign the same IP to a specific device based on its MAC address. This is called a DHCP reservation. The device still goes through the DORA process, but the server always offers the same address.
Common uses: printers, NAS devices, home servers, game consoles, security cameras. Anything that benefits from a consistent address without leaving the DHCP ecosystem.
Most home routers support DHCP reservations in their admin panel under DHCP or LAN settings. Find the device by MAC address and assign a specific IP within the DHCP range.
Test It Yourself
Check Your IP
See the IP address your DHCP server assigned to your network. Free and instant.