What Is DHCP? Dynamic IP Assignment Explained

The protocol that automatically gives every device on your network its IP address — no manual configuration required

What Is DHCP and Why Does It Matter?

DHCP stands for Dynamic Host Configuration Protocol. It's the networking protocol responsible for automatically assigning IP addresses and other network configuration parameters to devices when they connect to a network. Without DHCP, a network administrator would have to manually configure the IP address, subnet mask, default gateway, and DNS servers on every single device — an enormous burden on large networks.

When you connect your phone to a coffee shop's Wi-Fi, a corporate network, or your home router, DHCP springs into action within milliseconds. It assigns your device a unique IP address from the router's available pool, along with all the other parameters needed to communicate on the network and access the internet.

DHCP operates on a lease model: addresses are not permanently assigned but loaned for a set period (the lease time). When the lease expires, the device must renew it or a new address may be assigned. This allows the network to reclaim addresses from devices that have disconnected and give them to new arrivals.

Your public IP address — visible at our IP checker — is assigned to your router by your ISP's DHCP servers using the same protocol, just at a larger scale.

The DORA Process: How DHCP Works

DHCP uses a four-message handshake known as DORA to assign an IP address. This occurs every time a device joins a network:

  1. D — Discover: Your device broadcasts a DHCPDISCOVER message to the entire network (destination: 255.255.255.255) since it doesn't yet know the DHCP server's address. The message says "I need an IP address — is there a DHCP server here?"
  2. O — Offer: The DHCP server responds with a DHCPOFFER message, proposing an available IP address along with subnet mask, lease duration, gateway, and DNS server information.
  3. R — Request: Your device sends a DHCPREQUEST broadcast accepting the offer (broadcast so other DHCP servers on the network know the device chose this offer).
  4. A — Acknowledge: The DHCP server sends a DHCPACK confirming the lease. Your device configures itself with the assigned parameters and joins the network.

This entire exchange typically completes in under 100 milliseconds. The simplicity and speed of DORA is one reason DHCP has been the standard IP assignment mechanism since RFC 1531 in 1993.

🛡️

Test Your Network's DNS Settings

Our DNS leak test checks if your DNS queries are going where you expect — free and instant.

Hide My IP Now

DHCP Lease Times and Address Management

Every DHCP assignment has a lease time — how long the device holds that IP address before needing to renew. Common lease times:

At 50% of lease time, the device sends a unicast DHCPREQUEST to try to renew the same IP. At 87.5%, it retries with a broadcast. If neither succeeds, the lease expires and the device starts the DORA process from scratch.

DHCP servers maintain a pool of addresses and track which are leased to whom. This pool is the DHCP scope — for example, your home router's scope might be 192.168.1.2 – 192.168.1.254, reserving 192.168.1.1 for itself. See this by accessing your router admin panel (find its IP with our router IP guide).

DHCP Reservations and Static Assignments

A key feature of most DHCP servers (including home routers) is DHCP reservations (also called static DHCP or IP reservation). This lets you associate a specific IP address with a specific device's MAC address, so that device always receives the same IP from DHCP — combining the convenience of DHCP with the predictability of a static address.

This is especially useful for:

To set up a DHCP reservation on your home router:

  1. Log into your router admin panel
  2. Find DHCP settings or "Address Reservation"
  3. Find the device's MAC address (usually in the connected clients list)
  4. Assign it a specific IP address within your subnet range

After reserving an IP, use our port checker to verify connectivity if you're setting up any internet-accessible services.

DHCP Security Concerns

DHCP operates on trust — any device can request an IP, and by default any device can respond as a DHCP server. This creates several attack vectors:

DHCP starvation: An attacker sends thousands of DHCP requests with spoofed MAC addresses, exhausting the server's address pool. Legitimate devices can no longer get IPs. Mitigated by DHCP snooping on managed switches, which rate-limits DHCP messages per port.

Rogue DHCP server: An attacker sets up their own DHCP server on the network and responds to DHCP requests faster than the legitimate server. They can assign themselves as the default gateway (man-in-the-middle attack) or point to malicious DNS servers. This can redirect all your internet traffic through the attacker. Mitigated by DHCP snooping configured to only allow DHCP responses on trusted uplink ports.

After connecting to an unfamiliar network, it's worth running a DNS leak test to verify your DNS queries are going to expected servers and not being redirected by a rogue DHCP/DNS server. This is especially important on public Wi-Fi.

Special Offer

Frequently Asked Questions

What happens if DHCP fails — can I still connect?

If DHCP fails, your device will typically assign itself an APIPA address in the 169.254.x.x range after ~30 seconds of retry attempts. This allows local network communication but not internet access. You can manually configure a static IP matching your network's range as a workaround — check our <a href='/how-to-find-router-ip-address'>router IP guide</a> for the correct network parameters.

Does my phone keep the same IP address?

Your phone gets a private IP from your router via DHCP when it joins your Wi-Fi. Whether it keeps the same IP depends on the router's lease time and whether addresses are reserved. Most modern routers remember recent device assignments and try to give the same IP, but it's not guaranteed without a DHCP reservation.

What is the difference between DHCP and DNS?

DHCP assigns IP addresses to devices on a local network. DNS translates domain names (like google.com) into IP addresses for internet routing. They're separate protocols but work together: DHCP often provides DNS server addresses as part of the configuration it hands out, telling devices which DNS servers to use.

Can a device have a static IP and still use DHCP?

Yes, in two ways: (1) A DHCP reservation in the router always assigns the same IP to a specific MAC address — the device still uses DHCP but always gets the same result. (2) You can manually configure a static IP on the device that's outside the DHCP pool range, avoiding conflicts. The first approach is generally preferred for ease of management.

Special Offer×