How does DHCP assign network settings?
Useful first: IP addresses · optional, not a requirement
Choose your depth
Stay with the essentials, or look closer.
YOUR GOALSeparate automatic network setup from an internet connection that actually works.
Getting ready to use a network
A settings desk for your device
Imagine arriving at an office with a laptop. Instead of typing network settings yourself, the laptop can ask a DHCP server for them. The laptop is the client; the server manages the available addresses and configuration.
This explanation covers DHCPv4, the IPv4 protocol. Manually configured addresses are another possibility; DHCP is not how every device gets every address.
[1] [6]More than an address
A reply can supply an IP address, a subnet mask, a default router and DNS server addresses. These settings have different jobs. DHCP can tell your laptop which DNS server to use; DNS handles name lookups.
For example, the laptop might receive 192.168.1.20 for an office network. That is configuration for this network, not a permanent identity for the laptop everywhere.
A lease is a time limit
With dynamic allocation, an address is leased for a period. The client can seek an extension before it expires. Think of a library loan that can be renewed, rather than a purchase.
Receiving a lease is one successful setup step. A broken connection farther along the path can still prevent a website from opening.
[1] [6]DHCP reduces manual setup; a lease is permission to use an address for a limited time.
If DHCP worked, the internet must be working too.
DHCP supplies configuration. Reaching a website also depends on the network path and the services you contact.
Show the explanation
Network configuration, but not proof that a website is reachable. DHCP supplies settings. Successful configuration alone does not test a website, and a dynamic lease is time-limited.
YOUR GOALRead a fresh DHCPv4 exchange and identify the role of each supplied setting.
Following an initial lease
Discover, Offer, Request, Ack
A common fresh allocation follows four messages, often called DORA:
DHCPDISCOVER: the client looks for a server.DHCPOFFER: a server proposes an address and settings.DHCPREQUEST: the client requests the selected offer.DHCPACK: the selected server confirms the allocation.
An offer alone is not a completed lease. The client also checks that the address is usable before using it. Renewal and reuse of a remembered address need not repeat this whole exchange.
[3] [4] [5]Read the settings separately
Consider this illustrative configuration:
Address: 192.168.1.20
Subnet mask: 255.255.255.0
Router: 192.168.1.1
DNS server: 192.168.1.53The mask helps identify the local subnet. The router provides a next hop for traffic beyond it; the DNS server answers name queries. These roles need not share one address. DHCP options 1, 3 and 6 carry the subnet mask, router list and DNS server list respectively.
[2]How a server on another subnet can help
DHCPv4 client/server messages use UDP: server port 67 and client port 68. Initial discovery commonly uses broadcast, but not every DHCP packet is broadcast.
A configured DHCP relay forwards messages between clients and a server on another subnet. An office can therefore serve several network segments without placing a DHCP server on each one.
[3] [6]Follow the exchange through confirmation, then inspect the address, router and DNS settings as separate pieces.
Seeing DHCPOFFER means the client can immediately use that address.
The usual fresh exchange still requires the client's request and the server's acknowledgement, followed by the client's address checks.
Show the explanation
DHCPACK from the selected server. DHCPACK confirms this allocation. An offer proposes it; an HTTP response belongs to a different application exchange.
YOUR GOALDistinguish renewal failure from expiry, and configuration delivery from trustworthy configuration.
Renewal, conflicts and trust
Renew first, then rebind
At T1, the client tries to renew by unicasting a DHCPREQUEST to the original server. Without an acknowledgement by T2, it broadcasts a request to seek an extension from any available server.
The server can configure these times. Their defaults are 50% and 87.5% of the lease, with timing variation recommended. For a one-hour example explicitly configured at those fractions, renewal starts at 30 minutes, rebinding at 52 minutes 30 seconds, and expiry at 60 minutes. They are not universal fixed intervals.
[4] [6]Expiry and conflicts are different failures
A missed renewal reply does not itself end a still-valid lease. If the lease expires without renewal, the client must stop using that leased address and start initialization again.
A conflict is different: another device may already be using the proposed address on the local link. IPv4 Address Conflict Detection uses ARP probes before use. A DHCP client that finds the supplied address in use reports DHCPDECLINE and restarts configuration. Receiving an ACK is therefore not a guarantee against conflicts.
An answer is not proof of trust
The base protocol does not make every responding server trustworthy. An unauthorized server can supply misleading router or DNS settings. Successful DHCP configuration is not a security endorsement of the network.
When diagnosing a failure, distinguish no offer, no acknowledgement, a detected conflict and an expired lease. They describe different points in the setup process; changing random settings hides that distinction.
[4] [6]Track the lease state and its actual timers; do not confuse a timeout, an address conflict or an untrusted reply.
If the original DHCP server misses one renewal, the client must immediately discard its address.
An unexpired lease can remain usable while the client retries and later rebinds. Expiry without renewal requires it to stop using the leased address.
Show the explanation
Broadcast a DHCPREQUEST to seek renewal from an available server. T2 starts rebinding. The current lease has not yet expired, but if no renewal arrives before expiry the client must stop using that leased address.
Keep asking. Check the details.
Source-checked using AI (OpenAI Codex) on . The checks covered sources, examples, and quizzes for this article version.
No human review is claimed. AI review can miss errors; check the original sources below.
- Microsoft Learn — DHCP Server overview
- RFC 2132 — DHCP options: subnet mask, router and DNS
- Microsoft Learn — DHCP protocol basics and packet examples
- RFC 2131 — DHCPv4 allocation, renewal and security
- RFC 5227 — IPv4 address conflict detection
- Microsoft Learn — DHCP troubleshooting and relay overview