What Is DHCP? (Dynamic Host Configuration Protocol)

DHCP serves as the traffic cop on your network

Picture of four hands using smartphones
© James Boast / Ikon Images / Getty Images

Dynamic Host Configuration Protocol (DHCP) provides quick, automatic, and central management for the distribution of IP addresses in a network.

DHCP is also used to configure the correct subnet mask, default gateway, and DNS server information on a device.

How DHCP Works

A DHCP server issues unique IP addresses and automatically configures other network information. In most homes and small businesses, the router acts as the DHCP server. In large networks, a single computer might act as the DHCP server.

The process goes like this: A device (the client) requests an IP address from a router (the host), after which the host assigns an available IP address to allow the client to communicate on the network. If only it were that simple.

Behind-the-Screens DHCP Process

When a device is turned on and connected to a network that has a DHCP server, it sends a request to the server, called a DHCPDISCOVER request.

After the DISCOVER packet reaches the DHCP server, the server attempts to hold on to an IP address that the device can use and then offers the client the address with a DHCPOFFER packet.

When the offer is made for the chosen IP address, the device responds to the DHCP server with a DHCPREQUEST packet to accept it, after which the server sends an ACK that confirms the device has that specific IP address and defines the amount of time the device can use the address before getting a new one.

If the server decides that the device cannot have the IP address, it sends a NACK.

All of this happens in the blink of an eye, and you don't need to know any of the technical details to get an IP address from a DHCP server.

An even more detailed look at the different packets involved in this process is on Microsoft's DHCP Basics page.

Pros and Cons of Using DHCP

A computer or any other device that connects to a network (local or internet) must be appropriately configured to communicate on that network. Since DHCP allows that configuration to happen automatically, it's used in almost every device that connects to a network, including computers, switches, smartphones, gaming consoles, tablets, and other devices.

Because of the dynamic IP address assignment, there's little chance that two devices have the same IP address, which can happen with manually assigned, static IP addresses.

Using DHCP makes a network much easier to manage. From an administrative point of view, every device on the network can get an IP address with nothing more than its default network settings, which are set up to obtain an address automatically. The only other alternative is to assign addresses to each device on the network manually.

Because these devices can get an IP address automatically, they can move freely from one network to another as long as they're all set up with DHCP and receive an IP address automatically, which is super helpful with mobile devices.

In most cases, when a device has an IP address assigned by a DHCP server, the IP address changes each time the device joins the network. If IP addresses are assigned manually, administration must not only give out a specific address to each new client, but also existing addresses that are already assigned must be manually unassigned for any other device to use that same address. This process is time consuming, and manually configuring each device increases the chance of running into human errors.

Although there are plenty of advantages to using DHCP, there are some disadvantages as well. Dynamic, changing IP addresses should not be used for devices that are stationary and need constant access, such as printers and file servers. Devices like that exist predominantly in office environments, so it's impractical to assign them with an ever-changing IP address. For example, if a network printer has an IP address that changes at some point, every computer that's connected to that printer has to regularly update its settings to understand how to contact the printer.

This type of setup is unnecessary and can be easily avoided by not using DHCP for those types of devices and instead by assigning a static IP address to them.

The same idea comes into play if you need to have permanent remote access to a computer in your home network. If DHCP is enabled, the computer gets a new IP address at some point, which means the one you've recorded for that computer is not accurate for long. If you use remote access software that relies on an IP address-based access, you need to use a static IP address for that device.

More Information on DHCP

A DHCP server defines a scope or range of IP addresses that it uses to serve devices with an address. This pool of addresses is the only way a device can obtain a valid network connection.

Using a range of IP addresses allows lots of devices to connect to a network over a period of time without needing a massive pool of available addresses. For example, even if only 20 addresses are defined by the DHCP server, 30, 50, or even 200 or more devices can connect to the network as long as no more than 20 are using one of the available IP addresses simultaneously.

Because DHCP assigns IP addresses for a specific period (a lease period), using commands such as ipconfig to find your computer's IP address yields different results over time.

Although DHCP is used to deliver dynamic IP addresses to its clients, that doesn't mean static IP addresses can't also be used at the same time. A mixture of devices that get dynamic addresses and devices that have their IP addresses manually assigned to them can exist on the same network.

Even an ISP uses DHCP to assign IP addresses, which can be seen when identifying your public IP address. It changes over time unless your home network has a static IP address, which is usually only the case for businesses that have publicly accessible web services.

In Windows, Automatic Private IP Addressing (APIPA) assigns a temporary IP address when the DHCP server fails to deliver a functional one to a device and uses this address until it can obtain one that works.

The Dynamic Host Configuration Working Group of the Internet Engineering Task Force created DHCP.