What Is DHCP? How Your Devices Get an IP Address
What is DHCP? It is the protocol that hands your devices an IP address, gateway and DNS servers automatically. How leases, reservations and DHCPv6 work.
In this guide
DHCP (Dynamic Host Configuration Protocol) is the protocol a device uses to ask the network for an IP address and receive one automatically, together with the subnet mask, default gateway and DNS servers. On a home network the router runs the DHCP server. The address is a lease with an expiry time, which the device renews in the background.
Test it now
Cloudflare edgeRead at the Cloudflare edge from this request. The homepage adds your provider, network type and the VPN, DNS and WebRTC checks.
Show detailsWhat DHCP does
DHCP removes the need to type network settings into every device. RFC 2131, the IPv4 specification, describes a client/server protocol: a server holds a pool of addresses and hands one to any client that asks, with the parameters needed to use it. Microsoft's Windows Server documentation puts it plainly. DHCP "maintains a pool of IP addresses and leases an address to any DHCP-enabled client when it starts up on the network."
The parameters travel as numbered options defined in RFC 2132: option 1 (subnet mask), option 3 (router, which becomes your default gateway), option 6 (domain name servers) and option 51 (IP address lease time) are the ones that matter at home.
RFC 2131 defines three allocation methods: dynamic (a lease "for a limited period of time," the home default), automatic (a permanent address from the pool) and manual (the administrator picks the address), which is the mechanism behind a DHCP reservation.
How a DHCP lease works (DORA)
A new client gets its address through four messages that RFC 2131 names DHCPDISCOVER, DHCPOFFER, DHCPREQUEST and DHCPACK, abbreviated DORA. The exchange runs over UDP: clients send to server port 67, servers reply to client port 68.
- Discover. The client has no address yet, so it broadcasts a DHCPDISCOVER, a "client broadcast to locate available servers."
- Offer. Each server that can help answers with a DHCPOFFER containing a proposed address and the configuration options.
- Request. The client picks one offer and broadcasts a DHCPREQUEST naming the chosen server, which tells the others to withdraw. The same message later confirms a previously held address or extends a lease.
- Acknowledge. The chosen server commits the address and replies with a DHCPACK carrying the "configuration parameters, including committed network address." Only now does the client configure its interface.
Three other messages matter. A DHCPNAK tells a client that the address it believes it holds is wrong, for example after it moved networks. A DHCPRELEASE gives an address back early; Windows sends one when you run ipconfig /release. A DHCPINFORM is for a client that already has an address and only wants the other parameters.
DHCP vs static IP
A static IP address is one you type into the device yourself; a DHCP address is one the server leases to it. For almost every device at home, DHCP is the right choice, and Windows' own settings page recommends "Automatic (DHCP)" over "Manual."
A static address makes sense when something else needs to find the device at a fixed address: a printer, a NAS, a camera, or a console with a port-forwarding rule. The catch is that a static address is invisible to the DHCP server. If you type 192.168.1.50 into a printer and the router's pool also covers 192.168.1.50, the router may lease that address to a new phone and the two collide. Windows Server avoids this with an exclusion range the server "is not allowed to use"; home routers let you narrow the pool, for example to 192.168.1.100–199, and keep lower addresses for manual use.
A lease also delivers the gateway and DNS servers, so a statically addressed device must have those typed in too and never learns about changes. That is the strongest argument for reservations, below. The guide to static vs dynamic IP addresses covers the public-address side of the same question, where "static" means an address your ISP does not change.
What is a DHCP reservation?
A DHCP reservation tells the server to always lease a particular address to a particular device, identified by its hardware (MAC) address or client identifier. Microsoft defines reservations as "reserved IP addresses associated with particular DHCP clients," which "allows consistent assignment of a single IP address to a single DHCP client."
A reservation gives you the stability of a static address without its drawbacks: the device still receives the gateway and DNS servers by DHCP, still works on another network, the server knows the address is taken, and the configuration lives in one place. Google's Nest Wifi documentation lists the two common reasons to set one: a printer other machines need to find, and port forwarding, which needs a reservation or static IP so the rule keeps pointing at the right device. On Google Nest Wifi the documented path is Google Home app > Wifi > Network settings > Advanced Networking > DHCP IP reservations; other routers put it under LAN or DHCP settings as "address reservation" or "static lease." The device keeps its current lease until it renews or reconnects, so you may need to disconnect and reconnect it before the reserved address applies.
DHCP lease time: what it should be
The lease time is the period, in seconds, that a client may use an address before it must renew. It is carried in option 51, and RFC 2131 reserves the value 0xffffffff for an infinite lease. Two timers hang off it: T1, after which the client tries to renew, "defaults to (0.5 * duration_of_lease)," and T2, after which it tries to rebind, "defaults to (0.875 * duration_of_lease)."
The timers explain why a working lease is invisible to you. At T1 the client sends a unicast DHCPREQUEST to the server that gave it the address; a normal server acknowledges and restarts the clock, so the address never changes. If that server is silent until T2, the client broadcasts the request so any server can take over. Only if nothing answers before expiry does the client move "to INIT state," "immediately stop any other network processing" and start again from DHCPDISCOVER.
The trade-off is pool turnover against stability: short leases (an hour or less) suit guest networks where devices come and go; long leases (days) keep addresses stable through router restarts, at the cost of removed devices holding addresses until expiry. Microsoft's Windows Server planning example uses eight days. For a home network the router's default is fine; shorten it if you run out of addresses, lengthen it or add reservations if devices lose connectivity when the router restarts.
DHCP vs DNS (and NAT): what each one does
DHCP gives a device its address; DNS turns names into addresses; NAT lets many private addresses share one public address. The first two get confused because both are automatic, both usually run on the router, and DHCP is how your device learns which DNS server to use (option 6).
| DHCP | DNS | NAT | |
|---|---|---|---|
| Question it answers | What is my IP address, gateway and DNS server? | What is the IP address of example.com? | Which inside device does this returning packet belong to? |
| Who runs it at home | The router's DHCP server | The router, forwarding to your ISP or a resolver you chose | The router |
| When it runs | Once when you connect, then at renewal (T1, T2) | Every time an app needs a new name | On every packet crossing the router |
| Transport | UDP 67 (server) and 68 (client); DHCPv6 uses 546 and 547 | UDP/TCP 53, or encrypted over HTTPS/TLS | Not a protocol; it rewrites addresses in IP and transport headers |
| Defining RFC | RFC 2131 / 2132 (IPv4), RFC 9915 (IPv6) | RFC 1034 / 1035 | RFC 3022 |
| What breaks without it | Devices self-assign 169.254.x.x and reach nothing | Addresses work, names do not | Only one device could use the public address |
If a site "cannot be found" but a connection by IP address works, the problem is DNS; a 169.254 address or missing gateway points to DHCP.
DHCPv6 and IPv6: SLAAC vs DHCPv6
IPv6 devices can configure themselves without any server, so DHCP plays a smaller role. The mechanism is Stateless Address Autoconfiguration (SLAAC), RFC 4862, which "requires no manual configuration of hosts, minimal (if any) configuration of routers, and no additional servers." Routers advertise the network prefix in Router Advertisements; the host appends its own interface identifier and the address is complete.
DHCPv6 is now defined in RFC 9915, which obsoletes RFC 8415, and differs from IPv4 DHCP in concrete ways:
- Ports and addressing. Clients listen on UDP 546, servers and relays on 547. IPv6 has no broadcast, so the client sends to the multicast group All_DHCP_Relay_Agents_and_Servers, ff02::1:2, "so that the client need not be configured with the address or addresses of DHCP servers."
- Messages. The four-message exchange is Solicit, Advertise, Request, Reply. A Rapid Commit option in the Solicit lets a server answer with an immediate Reply. A client that already has a SLAAC address and only wants DNS servers sends an Information-request.
- Identity and leases. Clients are identified by a DUID rather than a MAC address, and leases come as IA_NA (addresses) or IA_PD (delegated prefixes, how your ISP hands your router a block of addresses).
- Timers. RFC 9915 recommends T1 and T2 of 0.5 and 0.8 times the shortest preferred lifetime, against IPv4's 0.5 and 0.875.
The router decides which applies: RFC 9915 lists "when a Router Advertisement indicates that DHCPv6 is available for address configuration" as a trigger for a client to start DHCPv6. Most home networks use SLAAC for addresses and DHCPv6, if at all, only for DNS servers.
How to see your DHCP address and lease
The quickest check on any device is the local IP checker. It shows the private (LAN) address your browser reveals, when the browser allows it, and explains the range: 192.168.x.x, 10.x.x.x or 172.16–31.x.x is a normal private lease from your router; 169.254.x.x means no DHCP server answered; 100.64.x.x is a carrier-grade NAT range. It does not show lease times; for those use the operating system.
Windows 10 and 11 (menu names from Microsoft's current settings documentation):
- Open Settings > Network & internet, then select Wi-Fi and your network, or Ethernet. The address appears next to IPv4 address, and the IP assignment line says Automatic (DHCP) or Manual.
- For lease details, open Command Prompt and run
ipconfig /all, which Microsoft describes as displaying "the full TCP/IP configuration for all adapters." - To force a new lease, run
ipconfig /release, which "sends a DHCPRELEASE message to the DHCP server," followed byipconfig /renew.
macOS (menu names from Apple's current Mac User Guide, System Settings layout):
- Open the Apple menu > System Settings, click Network in the sidebar, select your connection and click Details.
- Click TCP/IP. The Configure IPv4 menu shows Using DHCP, Using DHCP with manual address, Manually or Off; Configure IPv6 offers Automatically, Manually or Link-local only.
- Click Renew DHCP Lease to ask the router for a fresh lease. The DHCP client ID field sets a client identifier if your network requires one.
On Android, iPhone and iPad the labels differ by manufacturer and version, so the local IP checker is the quickest way to confirm which range your phone's address falls in.
Troubleshooting: 169.254 addresses and "no DHCP server"
A device whose address begins 169.254 did not get a DHCP lease. RFC 3927 defines the 169.254/16 prefix for this case: a host may "automatically configure an interface with an IPv4 address in the 169.254/16 prefix that is valid for Link-Local communication" when no other mechanism is available, and such addresses "are not suitable for communication with devices not directly connected to the same physical (or logical) link." Microsoft calls its implementation Automatic Private IP Addressing (APIPA): a Windows computer "can assign itself an Internet Protocol (IP) address in the event that a DHCP server is not available," using 169.254.0.0–169.254.255.255 with a 255.255.0.0 mask, and keeps sending Discover messages until a server answers. The guide to 169.254 IP addresses covers the range in depth.
Work through the causes in order of likelihood:
- The request never reached the router. A bad cable, a dead switch port, or Wi-Fi that associated but drops frames.
- The router's DHCP server is off, or there are two. Confirm it is enabled. A second router or mesh node left in router mode runs its own DHCP server; put it in access point or bridge mode.
- The pool is exhausted. A small pool such as 192.168.1.100–120 fills up on a network full of smart devices. Widen the range or shorten the lease.
- A MAC filter blocks the device, so it never gets an offer.
- A stale lease or leftover manual settings. Release and renew, or forget and rejoin the network; make sure IP assignment is Automatic (DHCP) on Windows or Using DHCP on macOS.
Windows reports this failure as "Ethernet doesn't have a valid IP configuration" (or the Wi-Fi equivalent); the step-by-step fix for that error applies the same diagnosis. A device with a normal 192.168.x.x address but no internet is a different case: the lease succeeded, so look at the gateway, DNS or the router's WAN side instead.
Sources
- RFC 2131: Dynamic Host Configuration Protocol
- RFC 2132: DHCP Options and BOOTP Vendor Extensions
- RFC 9915: Dynamic Host Configuration Protocol for IPv6 (DHCPv6) (obsoletes RFC 8415)
- RFC 8415: Dynamic Host Configuration Protocol for IPv6 (DHCPv6)
- RFC 4862: IPv6 Stateless Address Autoconfiguration
- RFC 3927: Dynamic Configuration of IPv4 Link-Local Addresses
- RFC 1034: Domain Names - Concepts and Facilities
- RFC 1035: Domain Names - Implementation and Specification
- RFC 3022: Traditional IP Network Address Translator (Traditional NAT)
- Microsoft Learn: What is DHCP Server in Windows Server?
- Microsoft Learn: Deploy DHCP Using Windows PowerShell (scopes, exclusion ranges, reservations)
- Microsoft Learn: ipconfig command reference
- Microsoft Learn: How to use automatic TCP/IP addressing without a DHCP server (APIPA)
- Microsoft Support: Essential network settings and tasks in Windows
- Apple Support: Change TCP/IP settings on Mac
- Apple Support: Use DHCP or a manual IP address on Mac
- Android Help: Connect to Wi-Fi networks on your Android device
- Google Nest Help: Set DHCP IP reservation or a Static IP address for a device
Questions
What does DHCP stand for?
Dynamic Host Configuration Protocol. It is defined for IPv4 in RFC 2131, with its options (subnet mask, router, DNS servers, lease time) in RFC 2132, and for IPv6 as DHCPv6 in RFC 9915. “Dynamic” refers to addresses being leased for a limited time rather than fixed.
Should DHCP be on or off on my router?
On. Without a DHCP server, every phone, laptop and TV on the network would need an address, mask, gateway and DNS servers typed in by hand, and devices that cannot get a lease fall back to a useless 169.254.x.x address. Turn it off only if another device on the same network is already the DHCP server.
Is DHCP the same as Wi-Fi?
No. Wi-Fi gets your device onto the network at the radio level; DHCP runs afterward, over that connection, to hand the device an IP address. The same DHCP exchange happens over an Ethernet cable. A Wi-Fi connection that shows “connected” but has no internet is often a DHCP failure, not a Wi-Fi failure.
What is a DHCP lease time?
The number of seconds a DHCP server allows a client to use an address, carried in option 51. The client tries to renew at half the lease by default and keeps the same address if the server agrees. Defaults vary by router; Microsoft’s Windows Server planning example uses eight days.
How do I fix DHCP issues?
Confirm the symptom first: an address starting 169.254 means no DHCP server answered. Then check the cable or Wi-Fi link, make sure the router’s DHCP server is enabled and there is only one, widen an exhausted pool, clear any MAC filter, and release and renew the lease with IP assignment set back to automatic.
Back to your own address: see your public IP

