Blog • SHM Soft

What Is DHCP? How Dynamic IP Assignment Works

DHCP is the reason you never have to type an IP address into your phone. It hands out addresses automatically, along with the mask, gateway, and DNS. Here is how it works, step by step.

Published 28 November 2026 • SHM Soft

When your phone joins a Wi-Fi network, it needs an IP address before it can do anything. Nobody types one in. Nobody keeps a list. The phone just connects, and a second later it is online. That magic has a name: DHCP.

DHCP stands for Dynamic Host Configuration Protocol. It is the service that hands out IP addresses and other network settings automatically. In this guide, we explain what DHCP is, how the DORA process works, what leases and relay are, and what to do when DHCP breaks.

Home Wi-Fi router that hands out IP addresses with DHCP

What Is DHCP?

DHCP is a network service that automatically gives devices the settings they need to join a network. When a device connects, the DHCP server offers it an IP address, a subnet mask, a default gateway, and one or more DNS server addresses. The device accepts, configures itself, and starts working. The whole exchange takes less than a second, and the user never sees it.

Without DHCP, someone would have to configure every device by hand. On a network with ten devices, that is annoying. On a network with a thousand devices, it is impossible. People would mistype addresses, two devices would get the same address, and the helpdesk would spend all day fixing conflicts. DHCP removes all of that. The server keeps the list, hands out addresses from a pool, and makes sure no two devices get the same one at the same time.

Your home router is a DHCP server. So is the server in most offices, or the router itself if it is configured that way. A Cisco router can act as a DHCP server too, which is a CCNA lab topic. Wherever it runs, the job is the same: keep a pool of addresses, lend them out, and take them back when devices leave.

What does DHCP hand out?

An IP address is the main thing, but it is not the only thing. A DHCP offer usually includes the subnet mask, so the device knows the size of its network. It includes the default gateway, which is the router the device uses to reach other networks. It includes DNS server addresses, so the device can turn names like google.com into IP addresses. And it can include other options, like the address of a time server, the domain name, or the address of a boot server for devices that load their software from the network.

All of this is agreed by the network administrator in advance. The DHCP server holds a scope, which is the range of addresses it may hand out, and a set of options. Every device that asks gets a consistent, correct set of settings.

DHCP leases

A DHCP address is not given forever. It is leased, usually for hours or days. A typical home router leases addresses for 24 hours. When half the lease time has passed, the device asks the server to renew it. If the server agrees, the lease is extended, and the device keeps the same address. If the device leaves the network, the lease expires, and the address goes back into the pool for someone else.

Leases are what make DHCP work in places where devices come and go. A coffee shop might see hundreds of different phones in a day, but it only needs enough addresses for the ones connected right now. When a customer leaves, their address is freed up within hours. Without leases, the pool would run dry by lunchtime.

The DORA Process, Step by Step

Getting an address takes four messages, and the mnemonic is DORA: Discover, Offer, Request, Acknowledge. It is one of the most tested topics on the CCNA, so it is worth learning properly.

Step one is Discover. The device has no address yet, so it cannot talk to a specific server. Instead, it sends a broadcast to the whole local network, from the address 0.0.0.0 to 255.255.255.255, asking if any DHCP server is out there. Every device on the network hears it, but only a DHCP server answers.

Step two is Offer. A DHCP server that hears the Discover replies with an Offer. The Offer says: here is an address you can use, here is the mask, here is the gateway, and here is how long you can keep it. If there are two servers, the device may get two offers, and it usually takes the first one that arrives.

Step three is Request. The device sends a Request message, again as a broadcast, saying: I accept the offer from this server. It is a broadcast so that any other server that made an offer knows its offer was not taken, and can put that address back in its pool. Step four is Acknowledge. The chosen server sends an ACK, confirming the deal. The device configures itself with the settings, and it is online.

DHCP Relay: Reaching Across Networks

There is a catch with DHCP. Discover messages are broadcasts, and broadcasts do not cross routers. So a DHCP server on one network cannot hear the Discover messages from another network. If every network needed its own server, large companies would need hundreds of them.

DHCP relay solves this. A router with relay configured listens for DHCP broadcasts on its local network and forwards them, as unicast, to a central DHCP server on another network. The server replies to the router, and the router passes the answer back to the device. The device never knows the server is far away. On Cisco routers, this is the ip helper-address command, entered on the interface that faces the clients. It is a small configuration with a big effect, and it is a CCNA topic.

Relay is also why a single DHCP server can serve a whole company. One central server holds all the scopes, one for each network, and the routers forward the requests. It is easier to manage, easier to back up, and easier to keep consistent than a server on every floor of every building.

Office computer network where DHCP assigns addresses to every device

When DHCP Breaks

DHCP problems have a clear symptom: devices cannot get online, and they often show an address starting with 169.254. That is a link-local address, which a device gives itself when no DHCP server answers. If you see 169.254, DHCP failed. The question is why. Our guide on how to troubleshoot DHCP walks through these checks in order.

The first check is the obvious one: is the device actually connected? A loose cable or a wrong Wi-Fi password stops everything, including DHCP. The second check is the server: is it running, does it have free addresses in its pool, and is the scope active? A pool that has run out hands out nothing, and the fix is a bigger pool or a shorter lease time so addresses free up faster.

The third check is the relay. If clients are on a different network from the server, is the helper address configured on the right interface, and does it point at the right server? A missing or wrong helper address is one of the most common DHCP faults in real networks, and it produces exactly this symptom: local clients work, remote clients do not.

The fourth possibility is a rogue DHCP server. Someone plugs in a home router to the office network, and it starts handing out wrong addresses to everyone nearby. The symptoms are strange and random, because some devices get the right settings and some get the wrong ones. The fix is to find the rogue device and remove it, and the prevention is DHCP snooping on the switches, which blocks DHCP offers from untrusted ports. If you want the full picture of how addresses work, read our guide on what an IP address is and our guide on what NAT is, which explains what happens after DHCP hands the address out.

Watch on YouTube: DHCP Explained: What is DHCP? The DORA Process | CCNA 200-301

Reservations: the best of both worlds

Sometimes you want a device to always get the same address, but you do not want to configure it by hand. Printers and servers are the classic case. A DHCP reservation does this. You tell the server: whenever this MAC address asks, always give it this IP address. The device still uses DHCP, so it gets the mask and gateway automatically, but its address never changes. Everyone else keeps getting dynamic addresses from the pool.

Reservations are the right answer for almost everything that needs a fixed address in a modern network. They keep all the settings in one place, on the server, so you can see them, back them up, and change them without walking to each device. If you run a small office network and you are still setting static addresses on each printer by hand, reservations will save you time the first week you use them.

DHCP is one of those services that is invisible when it works and obvious when it does not. It is worth understanding, because it touches every device on every network you will ever manage. Learn DORA, learn leases, learn relay, and you will understand most of what DHCP does, including the parts that show up on the CCNA exam.

Frequently Asked Questions

What is DHCP in simple terms?

DHCP is a service that gives devices their network settings automatically. When a device joins a network, the DHCP server hands it an IP address, a subnet mask, a gateway, and DNS servers, so the device works right away with no manual setup.

What is the DORA process?

DORA is the four-step exchange a device uses to get an address: Discover, Offer, Request, Acknowledge. The device broadcasts a Discover, the server replies with an Offer, the device sends a Request to accept it, and the server confirms with an Acknowledge.

What is a DHCP lease?

A lease is the length of time a device may keep the address it was given, usually hours or days. The device renews the lease halfway through. When the lease expires and is not renewed, the address goes back into the pool for another device.

What is a 169.254 address?

It is a link-local address a device gives itself when it cannot reach a DHCP server. If you see one, DHCP has failed, and you should check the connection, the server, and the relay settings.

What is DHCP relay?

DHCP relay lets a router forward DHCP requests from one network to a server on another network. It is configured with the ip helper-address command on Cisco routers, and it means one central server can serve many networks.

Conclusion

DHCP is the quiet service that makes networks usable. It hands out addresses, masks, gateways, and DNS settings automatically, it takes them back when devices leave, and it does it all in under a second. Without it, every device would need manual configuration, and large networks would be unmanageable.

Remember DORA, remember leases, and remember that a 169.254 address means DHCP failed. With those three ideas, you understand most of what DHCP does, and you can troubleshoot most of what goes wrong with it.

Related articles:

What Is an IP Address? A Complete Beginner's Guide

What an IP address is, public vs private, and how devices use them to find each other.

What Is NAT? Network Address Translation Explained

How NAT lets many devices share one public address, and why it exists.

What Is the OSI Model? The 7 Layers Explained

The seven layers of networking, and where DHCP sits in the model.

Want a clear price for your project?

Tell us what you need and we will send a free quote with no hidden charges.

Get a Free Quote