What is DHCP and why does your computer receive an IP automatically?
Published on 2026-10-20 by frfrand
DHCP explained without technical jargon: how the router assigns IP, subnet mask, gateway, and DNS, what a lease is, and how to fix connection failures.

Short answer: DHCP is the mechanism that allows your computer, cell phone, or console to automatically receive an IP address and other data to connect to a network. That's why most of the time you connect to Wi-Fi and everything works without typing a single number.
DHCP stands for Dynamic Host Configuration Protocol. It is one of those names that seem invented to complicate your life, but it solves a fairly everyday problem: if every person had to configure their IP address manually, connecting a new phone would be a nightmare.
The hotel example
Imagine you arrive at a hotel. You don't choose a room at random or ask the previous guest for the key. At reception they assign you a free room and tell you until when your reservation lasts.
On a network with DHCP something similar happens. Your device requests a configuration and a DHCP server —often your home router— offers it an address it can use for a period of time.
The metaphor has one difference: the server does not assign only the room number. It can also indicate where to exit the network and which service to ask to translate domain names.
What information does DHCP provide?
Normally, a client can receive four important things:
- IP address: the identifier you will use within that network, for example
192.168.1.27. - Mask or prefix: allows distinguishing which addresses belong to the local network.
- Gateway: usually the router to which traffic destined for other networks is sent.
- DNS servers: help find the IP address associated with names such as
ejemplo.com.
DHCP can also supply other parameters. Not all devices need exactly the same configuration.
How is an IP obtained? The four basic conversations
When a newly connected device needs an IPv4 address, a typical exchange follows these steps:
- Discover: asks if there is any DHCP server available.
- Offer: a server offers a configuration.
- Request: the client requests to use the chosen configuration.
- Acknowledgment (ACK): the server confirms the assignment.
Sometimes you will see it abbreviated as DORA, from the four English words. No need to memorize it: what matters is understanding that the device does not invent an address and start using it without coordination.
In a real network there are exceptions and additional messages, especially to renew assignments or detect problems.
Is the IP address I was given mine forever?
Not necessarily. DHCP usually delivers the address through a temporary lease, called lease. If the device remains connected, it can request to renew it. If it disconnects for a long time, that address could be assigned to another device when it is no longer reserved.
That explains something common: today your laptop has 192.168.1.27 and within a few weeks it appears with 192.168.1.35. It does not mean someone has entered your computer; it can simply be a new assignment.
If a device needs to keep the same address, many routers allow configuring a DHCP reservation associated with its network identifier. Static addresses also exist, but it is not advisable to assign them randomly within a range that the DHCP server is distributing.
Is DHCP the same as DNS?
No. DHCP can tell you which DNS server to use, but DNS is the system that resolves names to addresses and other records.
Another confusion: DHCP is not the same as Wi-Fi. You can use DHCP both via wireless connection and via cable. And there are networks with manual configuration without DHCP.
What happens when DHCP fails?
You can be physically connected to the network and still not have a valid address or a functional gateway. In Windows, for example, some automatic emergency configurations use addresses from the range 169.254.0.0/16 when there is no adequate DHCP response.
The possible causes include a DHCP server being turned off, a misconfigured network, traffic filtering, a faulty cable, or a client issue. Before changing options at random, check what address the device obtained and if it can communicate with its router.
What does this have to do with a VPS?
In virtual networks, address assignment mechanisms are also common. A VPS from ArduMaker, for example, is a container within a shared host: its internal address is delivered by the host network's DHCP and then remains fixed, so it doesn't change with a restart (the same idea as a DHCP reservation). The public IP that the internet sees is that of the host, not one of its own from the VPS, so you don't have to configure DHCP on the VPS for your application to be reachable.
Understanding DHCP does help distinguish an IP configuration problem from a web server problem. And if you run several of your own containers inside the VPS, for example with Docker, the rule still applies: it's not advisable for two devices to use the same address by accident.
In short: DHCP is what helps assign addresses and network parameters without you having to configure them manually every time. When you can't connect, understanding what it gave you is one of the first useful clues.
Frequently asked questions
How long does a DHCP lease last?
It depends on how the server is configured: on many home routers it ranges from a few hours to a few days. The client does not wait until the last minute: it attempts to renew it before it expires, usually when half of the period has passed.
How do I see what DHCP gave me?
On Windows, ipconfig /all shows the IP, the subnet mask, the gateway, the DNS servers, and the lease expiration. On Linux, ip addr shows the address and ip route shows the gateway. On macOS, you will find it in System Settings, under Network.
Is a DHCP reservation or a static IP better?
For a home printer or NAS, the reservation on the router is usually the most convenient: the device still requests its IP via DHCP, but always receives the same one. If you configure a static IP, choose one outside the range distributed by the DHCP server.
Sources: RFC 2131: DHCP protocol · Network configuration on Ubuntu Server · What is an IP and how it works.

Is DHCP also used for servers?
Your laptop usually receives an address automatically via DHCP, but a server's network configuration can be different: IP assigned by the provider, internal DHCP, fixed address, or controlled private networks. Do not change a server address assuming it will work the same as your home network.
On an ArduMaker VPS, what matters when publishing an application is something else: that the domain resolves to the platform and is activated on the host proxy (or that there is a port forwarding, if the service is not web) and on which port each process listens inside the VPS. A browsing failure may be due to DNS or the proxy, even if DHCP works perfectly on the visitor's computer.
Related: What is an IP address · What is DNS and a domain · Publish a domain with HTTPS on your VPS.