Free tech learning for everyone, from basics to pro

Start hereNetworking fundamentalsBasics

DHCP: how devices get an IP address automatically

In short: DHCP is the service that hands out network settings automatically. A device asks, a DHCP server offers an address, and the device accepts it for a set time (a lease).

The problem DHCP solves

Every device needs an IP address, subnet mask, default gateway and DNS server. Typing these by hand on hundreds of devices would be slow and full of mistakes. DHCP (Dynamic Host Configuration Protocol) does it automatically.

DHCP is like a hotel reception deskDiscover"Any rooms free?"Offer"Room 25 is free"Request"I will take it"Acknowledge"Here is your key"
Figure 1. Getting an address works like checking in at a hotel: the guest asks, reception offers a room, the guest accepts, and reception hands over the key until checkout time.

The four steps: "DORA"

  1. Discover: the new device shouts to the network, "Is there a DHCP server here?"
  2. Offer: the DHCP server replies, "You can use this address."
  3. Request: the device says, "Yes please, I'll take that address."
  4. Acknowledge: the server confirms, and the device starts using the settings.

Leases

Addresses are loaned, not given forever. Each one has a lease time (for example 8 hours or 1 day). Devices renew before the lease ends; addresses from devices that leave go back into the pool.

Where the DHCP server lives

  • At home: inside your Wi-Fi router.
  • In offices: often a server or the core switch, or a firewall.

When it fails

If a device shows a 169.254.x.x address, it couldn't reach a DHCP server. Check the cable or Wi-Fi, the VLAN, and whether the DHCP pool has run out of addresses. To request a new address:

ipconfig /release
ipconfig /renew

Security tip: in business networks, DHCP snooping on switches blocks fake DHCP servers. See the switch hardening playbook.

Real-world example: a busy Saturday at a café

A small café offers free Wi-Fi. Its router runs DHCP with a pool of, say, 50 addresses. On a normal weekday that is plenty: customers come and go, and addresses from phones that have left go back into the pool when their lease ends.

On a busy Saturday, the café is full, and every customer's phone, tablet and watch asks for an address. If the lease time is long (a day, for example), phones that left in the morning still "hold" their room keys. By the afternoon the pool is empty, and new customers see Wi-Fi connected but nothing loads, with a 169.254.x.x address on their device.

The usual fixes are a larger pool or a shorter lease for the guest network, such as an hour or two, so addresses return quickly. It is exactly like a hotel shortening its stays during a busy festival.

Try this: on Windows, run ipconfig /all and find the lines "Lease Obtained" and "Lease Expires". They tell you when your device checked in and when its key runs out.

Key takeaways

  • DHCP gives devices their network settings automatically.
  • DORA = Discover, Offer, Request, Acknowledge.
  • Addresses are leased for a time, then renewed or returned.
  • 169.254.x.x means DHCP didn't answer.
Tracks your learning on this device only. See your progress on the learning paths.

About the author

Mohamed Fayas

Founder of FM TecHub. CCNA certified, with a BTEC HND in Network Engineering, and BEng (Hons) in Computer Networking and Cloud Security. He writes practical, plain-English guides on networking, security and cloud.

More about the author

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Stay up to date by email

New notes, tools and security news from FM TecHub, explained simply. Free.

We only use your email to send these updates. See our privacy policy.