Networking guide

What Is DHCP? How IP Addresses Are Assigned Automatically

DHCP (Dynamic Host Configuration Protocol) hands out IP addresses and network settings automatically, so devices can join a network without manual setup.

What DHCP does

When a phone, laptop or printer joins a network it needs an IP address, a subnet mask, a default gateway and DNS servers. A DHCP server, usually built into the home or office router, gives these out from a pool of addresses called a scope.

How it works: DORA

StepMessageWhat happens
1DiscoverThe new device broadcasts a request asking for a DHCP server.
2OfferA server offers an available IP address and settings.
3RequestThe device asks to use the offered address.
4AcknowledgeThe server confirms and records the lease.

Leases and reservations

An address is lent for a limited time called a lease. The device asks to renew it before it expires. A reservation tells the server to always give the same address to a device with a particular MAC address, which is useful for printers, servers and cameras.

Check and renew on Windows

Open Command Prompt and use these commands:

ipconfig /all        (shows IP, gateway, DNS and whether DHCP is enabled)
ipconfig /release    (gives up the current lease)
ipconfig /renew      (asks for a new lease)

To find your address quickly, see how to find your IP address in Windows.

Common DHCP problems

  • An address starting with 169.254 means the device could not reach a DHCP server and gave itself a fallback address. Check the cable, Wi-Fi and router.
  • No free addresses in the scope means new devices cannot join. Enlarge the scope or shorten lease times.
  • Two DHCP servers on one network (for example two routers) can hand out conflicting settings. Keep only one active.
  • Duplicate IPs can happen when a device uses a manual address inside the DHCP scope. Move it outside the scope or create a reservation.

When to use a static IP

Use a fixed address for devices that other devices must always find, such as network printers. Prefer a DHCP reservation over typing the address into each device, so the router still knows about it.

Frequently asked questions

Is DHCP the same as DNS?

No. DHCP assigns addresses and settings. DNS turns names like example.com into addresses. See our DNS cache guide.

Where is the DHCP server?

Usually in your router. Larger networks may use a dedicated Windows or Linux server.

What is a good lease time?

Home networks often use a day or less. Networks with many short visits, such as cafes, use shorter leases.

← Back to Networking