What is DHCP? Leases, reservations and fixing “IP address conflict”

Nobody types an IP address into their phone when they join a Wi-Fi network. A small service on the router, DHCP, hands one out automatically, and most “IP address conflict” and “no internet” puzzles come down to that hand-out going wrong.

What happens when you join a network

Four quick messages, often remembered as DORA:

  1. Discover: your device shouts to the whole network, “is there a DHCP server?”
  2. Offer: the router replies with a free address, for example 192.168.1.23.
  3. Request: your device says “I'll take that one”.
  4. Acknowledge: the router confirms, with the gateway, DNS servers and how long the lease lasts.

Halfway through the lease the device quietly asks to renew, so it normally keeps the same address for as long as it stays connected. Home routers commonly lease for a day; the router remembers each device by its MAC address. For a plain-English version, see What is DHCP? on Wirebook, our sister site.

Renew your address

DeviceHow
WindowsCommand Prompt: ipconfig /release then ipconfig /renew. ipconfig /all shows the DHCP server and lease times.
MacSystem Settings → Wi-Fi → Details… → TCP/IP → Renew DHCP Lease. Or sudo ipconfig set en0 DHCP.
iPhone / iPadSettings → Wi-Fi → (i) next to the network → Renew Lease.
AndroidNo button on most phones: turn Wi-Fi off and on, or Forget the network and join again.
Linuxsudo dhclient -r && sudo dhclient, or with NetworkManager nmcli con down "Name" && nmcli con up "Name".

Fixing “IP address conflict”

Windows says “Windows has detected an IP address conflict”; a Mac says “Another device on the network is using your computer's IP address”. Work through these:

  1. Renew the address as above. If the conflict was a one-off (a device back from sleep with an old lease), that is the end of it.
  2. Look for a fixed address. Printers, cameras, game consoles and home servers are often set to a static address by hand. If that address sits inside the router's DHCP pool (say the pool is .2 to .254 and the printer is .50), the router will sooner or later lend .50 to someone else.
  3. Fix it properly: set the device back to automatic (DHCP) and create a reservation on the router instead, or keep the static address but shrink the DHCP pool so the two never overlap (for example pool .100 to .254, fixed devices .2 to .99).
  4. Two routers? If a second router or a mesh unit is also running DHCP on the same network, two servers hand out the same addresses. Turn DHCP off on the second one (often called access point or bridge mode). See double NAT for the related problem.

DHCP reservation vs static IP

DHCP reservationStatic IP on the device
Where it is setOn the router, onceOn each device
Conflict riskNone: the router never lends that address to anyone elseHigh if it is inside the DHCP pool
Gateway / DNS changesPicked up automaticallyMust be edited by hand
CatchPhones with a private (random) Wi-Fi address need it turned off for that network, or the reservation will not matchBreaks when the device moves to another network

Reservations live in the router's admin pages, usually under LAN, DHCP or Address reservation: see how to log in to your router.

A 169.254 address means DHCP did not answer

If a device gives itself a 169.254.x.x address, it asked and nobody replied: the router's DHCP is off, overloaded or the device is not really connected. Restart the router, renew, and check Wi-Fi connected but no internet.

Related

Wi-Fi keeps disconnecting · Default gateway and subnet mask explained · Find a MAC address on any device · Port forwarding not working (double NAT, CGNAT) · Public vs private IP address · Log in to your router (192.168.1.1) · Common port numbers explained

Questions

What is DHCP in simple terms?

The service on your router that automatically lends each device an IP address, plus the gateway and DNS settings, when it joins the network.

How do I fix an IP address conflict?

Renew the address (ipconfig /release and /renew on Windows, or Wi-Fi off and on). If it comes back, find the device with a fixed address inside the router's DHCP range and switch it to automatic with a reservation on the router.

What is a DHCP lease?

The length of time a device may keep the address it was given. Devices renew halfway through, so they usually keep the same address while connected.

Is a DHCP reservation better than a static IP?

For most home devices, yes. It is set once on the router, never conflicts and keeps working if the router's DNS or gateway settings change.

Why does my device have a 169.254 address?

It asked for an address and no DHCP server answered, so it picked one itself. Restart the router and renew the lease.

Published .

Try it

Related guides

Newest guides