DHCP assigns your device an IP address automatically when you connect to a network
Dynamic Host Configuration Protocol (DHCP) is a network service that hands out internet addresses to devices automatically. Instead of you typing in a unique number for your computer, phone, or printer every time you connect, DHCP does it for you. When your device joins a network — whether that's your home Wi-Fi, an office network, or a coffee shop — a DHCP server on that network assigns it a temporary address that lets it talk to other devices and reach the internet.
Without DHCP, someone would have to manually set up every device with its own IP address, subnet mask, and gateway information. That would mean remembering dozens of numbers, avoiding duplicates, and reconfiguring everything if you moved to a different network. DHCP eliminates that friction. It's the reason your phone connects to a new Wi-Fi network without you doing anything except entering the password.
Key Takeaways
- DHCP automatically assigns your device a temporary IP address when you connect to a network, so you don't have to enter one manually.
- The address DHCP gives you is temporary and gets recycled when you disconnect or when a set time period expires.
- Your home router almost always runs a DHCP server that hands out addresses to your Wi-Fi devices and wired computers.
- Most devices use DHCP by default, but you can set a static (permanent) address manually if a device needs to stay at the same address.
How DHCP works when you connect to a network
When your device connects to a network, it sends out a broadcast message asking "Does anyone have an address for me?" A DHCP server on that network hears the request and responds by offering an IP address from its pool of available addresses. Your device accepts the offer, and the server confirms the assignment. This whole handshake usually takes less than a second.
The address you receive comes with an expiration date called a lease time. A typical lease might last 24 hours or a week, depending on how the network is set up. When the lease is about to expire, your device asks to renew it. If you stay on the network, the server usually gives you the same address again. If you disconnect or the lease expires without renewal, that address goes back into the pool and can be given to another device.
This recycling system is why DHCP works well for networks with many devices coming and going. A coffee shop doesn't need a separate permanent address for every laptop that walks in. A DHCP server with 50 addresses can serve hundreds of customers over the course of a day because each address is only in use while someone is actually connected.
DHCP on your home network and router
Your home router almost certainly runs a DHCP server built into its firmware. When you buy a router and set it up, DHCP is usually turned on by default. The router's DHCP server manages a range of addresses — often something like 192.168.1.100 through 192.168.1.254 — and hands them out to your computers, phones, tablets, smart speakers, and any other device that connects to your Wi-Fi.
You can see which devices your router has assigned addresses to by logging into the router's admin panel, usually through a web browser or a manufacturer's app. Most routers let you set the lease time and the range of addresses available. You can also reserve a specific address for a particular device — useful for a printer or security camera that needs to stay at the same address so other devices can always find it.
If your internet service provider gives you a modem, that modem also has a DHCP server, but it typically hands out only one address — to your router. Your router then acts as the DHCP server for everything inside your home.
Static addresses versus DHCP addresses
A static address is one you set manually and that doesn't change. A DHCP address is temporary and can change. For most devices — your laptop, phone, tablet — DHCP is the right choice because you move between networks and don't need the same address everywhere.
Some devices benefit from a static address. A printer on your home network might get a different DHCP address after its lease expires, which means you'd have to reconfigure it. A security camera, a network-attached storage device, or a server you access regularly from the same network works better with a static address. You can set a static address either on the device itself or by creating a DHCP reservation on your router, which tells the DHCP server to always give that specific device the same address.
What DHCP does and doesn't do
DHCP assigns three main pieces of information: an IP address, a subnet mask (which tells your device which other addresses are on the same local network), and a default gateway (usually your router's address, which is how your device reaches the internet). Many DHCP servers also hand out the addresses of DNS servers, which translate website names into IP addresses.
DHCP does not secure your connection, encrypt your data, or control which websites you can reach. It only handles the mechanics of getting your device an address so it can communicate. Security and filtering are separate functions handled by firewalls, VPNs, and other tools.
DHCP on public and workplace networks
Coffee shops, libraries, hotels, and offices all use DHCP to hand out addresses to visiting devices. When you connect to a public Wi-Fi network, you're getting an address from that location's DHCP server. The lease time on public networks is often shorter — sometimes just a few hours — because devices come and go constantly.
Workplace networks often use DHCP as well, though they may combine it with additional security measures. Your work device might get a DHCP address, but that address might only work if your device is also authenticated through a login or a certificate. The DHCP server itself doesn't enforce that security; it just assigns the address.
Troubleshooting when DHCP isn't working
If your device can't connect to a network or says it has no internet connection, DHCP failure is one possible cause. Your device might show an address starting with 169.254 — that's a sign DHCP didn't work and your device assigned itself a fallback address that won't reach the internet or other devices.
Common fixes include restarting your device, restarting your router, or forgetting the network and reconnecting. If DHCP is still failing, check whether DHCP is turned on in your router's settings — it's usually on by default but can be accidentally disabled. On your device, make sure it's set to obtain an address automatically rather than using a static address. If you're on a workplace or public network, contact the network administrator to confirm DHCP is running and that your device isn't blocked.
Frequently Asked Questions
Can I turn off DHCP on my home router?
Yes, but you shouldn't unless you have a specific reason. If you turn off DHCP, every device on your network would need a manually configured static address. This is impractical for phones and laptops that move between networks. Some advanced users disable DHCP on one router when they have multiple routers, but that's a rare setup.
Why does my device sometimes get a different IP address?
When your DHCP lease expires, the server may assign you a different address from its pool. If you stay connected and renew your lease, you usually get the same address back. If you disconnect and reconnect later, or if the server is very busy, you might get a different one. This is normal and usually doesn't affect how your device works.
Is DHCP a security risk?
DHCP itself is not inherently insecure, but it doesn't provide security either. An attacker on the same network could potentially run a rogue DHCP server to hand out false addresses and redirect your traffic. This is why secure networks use additional authentication and encryption. For home networks, keeping your router's firmware updated and using a strong Wi-Fi password reduces this risk.
What happens if two devices get the same DHCP address?
A well-configured DHCP server won't hand out the same address twice. If a conflict does happen — usually because someone manually set a static address that overlaps with the DHCP pool — both devices will have network problems. The fix is to either change the static address or adjust the DHCP range so they don't overlap.
Do I need DHCP if I only have one device on my network?
DHCP is still useful even with one device because it handles address assignment automatically. You could use a static address instead, but you'd have to configure it manually. DHCP is simpler and more flexible if you ever add more devices or move that device to a different network.