Data

What Is DHCP and How Does It Work?

What is DHCP?

DHCP stands for Dynamic Host Configuration Protocol. It’s a client-server protocol that automatically gives a device an IP address and other core network settings, including the subnet mask and default gateway. The current DHCPv4 standard is defined by RFC 2131, and DHCP options are defined separately by RFC 2132. Microsoft’s Windows Server documentation describes it the same way: a protocol that automatically provides an IP host with its address and related configuration information.

In practical terms, DHCP saves you from typing network settings into every laptop, phone, printer, access point and till by hand. RFC 2131 was designed to do two things at once: deliver host-specific configuration parameters and allocate network addresses in a manageable way, including across networks that use relay agents rather than a server sat on every segment.

Think of DHCP as the front desk for your network. A new device arrives, asks for what it needs, and gets told: here’s your address, here’s your gateway, here are the DNS servers to use. Not glamorous, but if it stops working, people notice within minutes. Both the standards and the vendor documentation are consistent on this point: DHCP’s job is to hand out usable network configuration automatically, not just an IP address on its own.

How does DHCP work?

At a high level, DHCP runs as a conversation between a client and a server. RFC 2131 defines the best-known message flow: DHCPDISCOVER, DHCPOFFER, DHCPREQUEST and DHCPACK. Many engineers shorten that to DORA. The same RFC also defines renewal and rebinding states for existing leases, so DHCP is not only about first-time setup; it also manages life after the first address assignment. 

DHCPv4 runs over UDP. RFC 2131 puts client-to-server messages on port 67 and server-to-client messages on port 68, and IANA still lists those ports under the historic BOOTP service names bootps and bootpc, which DHCP inherited from its predecessor.

If your DHCP server sits on a different subnet, you’ll normally use a relay agent. RFC 2131 defines a relay agent as a host or router that passes DHCP messages between clients and servers, and it specifically notes that relay agents remove the need to place a DHCP server on every physical network segment.

For IPv6, the equivalent standard is DHCPv6, defined in RFC 8415. It can provide parameters statelessly, alongside stateful address assignment, or in place of or alongside SLAAC. IPv6 networks end up with more ways to mix and match address assignment and configuration than most IPv4 networks do.ds, IPv6 networks can mix and match address assignment and configuration methods more than many IPv4 networks do. 

What DHCP gives a device

At minimum, DHCP provides an IP address, a subnet mask and a default gateway. Microsoft’s documentation lists those as the basic information you’d expect a DHCP server to supply, and RFC 2132 defines the individual options used to deliver each piece.

It can also hand out DNS server addresses. RFC 2132 defines the Domain Name Server option, specifying a list of DNS servers available to the client, which is why a PC can usually join a network and start resolving names without anyone touching the adapter settings.

A lease is the period for which the address stays valid. RFC 2132 defines the IP Address Lease Time option, with the value expressed in seconds as a 32-bit unsigned integer, and RFC 2131 uses timers called T1 and T2 so the client can try to renew or rebind before the lease runs out.

In day-to-day administration, three terms matter more than the rest.

Scopes

A scope is the address range a DHCP server can allocate to clients on a given network. Microsoft’s DHCP quickstart describes scopes as the ranges of IP addresses used by the DHCP server and its clients. 

Exclusions

An exclusion range is part of that subnet that the DHCP server must not hand out. Microsoft documents exclusions as addresses or ranges that you do not want the server to distribute. This is useful if part of the subnet is reserved for devices that use static addressing. 

Reservations

A reservation ties a specific address to a specific device, typically using the device’s MAC address. Microsoft states that reservations ensure the DHCP server exclusively leases a specific IP address to a specific MAC address, and ISC’s Kea documentation notes that host reservations are designed to provide a pre-determined, unchanging address or consistent option values to a device. 

For a business network, that makes reservations useful for equipment that benefits from a predictable address but still fits more naturally into central DHCP management. Common examples include printers, Wi-Fi access points, POS terminals, CCTV recorders and devices that sit behind firewall rules based on source IP. ISC explicitly highlights fixed addresses for hosts that need firewall-based access or stable reachability if DNS lookups fail. 

DHCP vs static IP addresses

A common question is whether DHCP is “better” than a static IP address. In reality, most organisations use both. RFC 2131 supports three mechanisms for IP allocation: automatic allocation, dynamic allocation and manual allocation. Dynamic allocation gives an address for a limited period, while manual allocation lets the administrator assign the IP and use DHCP simply to convey it to the client.

“DHCP versus static IP” is often the wrong way to frame the decision in the first place. For end-user devices that come and go, dynamic leases usually make sense, since RFC 2131 specifically notes that dynamic allocation allows automatic reuse of addresses that are no longer needed. For infrastructure that needs a predictable address, reservations or manual and static allocation tend to fit better.

In practice, most businesses run DHCP for laptops, mobile devices and general office endpoints, then use reservations or static addressing for domain controllers, servers, firewalls, core switches and similar infrastructure. That’s an operational judgement rather than a rule written into any RFC, but it follows directly from the standards-based split between dynamic and manual allocation, plus vendor guidance on reservations and exclusions.

If you mix DHCP and static addresses on the same subnet, keep the plan tidy. Put static devices outside the active DHCP pool, or use exclusion ranges, otherwise you’ll end up with the kind of IP conflict that ruins an otherwise quiet afternoon. Microsoft’s DHCP guidance includes exclusions for exactly this reason.

Common DHCP issues and the security points that matter

When DHCP breaks, the symptoms often look simple even though the cause is not. A device may fail to get a proper address, lose access after a lease expires, or land on an address that only works locally. Microsoft documents that Windows can assign itself an address if no DHCP server is available, and RFC 3927 defines the IPv4 link-local range 169.254.0.0/16 for that purpose. RFC 3927 also makes clear that these addresses are suitable only for communication on the same physical or logical link and must not be forwarded by routers. 

So if you see a Windows device on 169.254.x.x, that usually points to a DHCP problem or a network path problem between the client and the DHCP service. It does not automatically mean the network card has failed, and it does not mean the device has a routable address that can reach the rest of the business network. Microsoft and RFC 3927 both describe this link-local behaviour clearly. 

Security matters here too. RFC 2131 says DHCP is built directly on UDP and IP and is therefore inherently insecure in its current form. One practical risk is a rogue DHCP server handing out bad settings, such as the wrong gateway or DNS servers. Cisco’s documentation for DHCP snooping explains that the feature acts like a firewall between untrusted hosts and trusted DHCP servers, validating DHCP messages and maintaining a binding database for leased addresses. 

For business networks, the sensible approach is straightforward: document scopes, keep exclusions tidy, use reservations where fixed addressing helps, protect switch ports and VLANs against rogue DHCP responses, and monitor lease failures and renewal issues. That fits well with the UK NCSC’s broader guidance that networks are fundamental to operational security and resilience. 

Frequently asked questions

What does DHCP stand for?

DHCP stands for Dynamic Host Configuration Protocol. RFC 2131 defines it as a framework for passing configuration information to hosts on a TCP/IP network. 

What is a DHCP server?

A DHCP server is the system that returns configuration parameters to DHCP clients. RFC 2131 defines the server in those terms, and Microsoft’s Windows Server documentation describes DHCP as a client-server protocol that automatically provides IP settings to hosts. 

What is a DHCP lease?

A DHCP lease is the period during which a client may use an assigned IP address. RFC 2132 defines the lease-time option, and RFC 2131 explains that clients use timers to renew and eventually rebind if needed. 

What port does DHCP use?

For DHCPv4, RFC 2131 says the protocol uses UDP, with clients sending to server port 67 and servers replying to client port 68. IANA’s service registry reflects those assignments. 

Is DHCP the same as DNS?

No. DHCP and DNS often work together, but they do different jobs. DHCP provides network configuration such as IP settings and can tell a client which DNS servers to use, while DNS maps computer names to IP addresses for name resolution. RFC 2132 defines the DHCP DNS-server option, and Microsoft’s DNS overview states that DNS maps computer names to IP addresses. 

Should I use DHCP reservations or static IP addresses?

It depends on the device and the management model you want. RFC 2131 supports both dynamic and manual approaches, while Microsoft and ISC document reservations as a way to keep a stable address for a known device without giving up central DHCP administration. For many businesses, that makes reservations a strong fit for printers, access points and other fixed-but-managed endpoints. 

What is the bottom line?

DHCP is the service that keeps IP addressing practical at business scale. It automates the boring but essential work of giving devices the right address, gateway, DNS settings and lease information. If you run a modern network and do not think about DHCP very often, that is usually a sign it is doing its job properly. The trick is to keep the design clean, the scopes documented, and the security controls strong enough that the “automatic” part does not become the “mysterious” part.