What is DHCP and why does your computer receive an IP automatically?

Published on 2026-10-20 by frfrand

DHCP explicado sin tecnicismos: cómo el router asigna IP, máscara, puerta de enlace y DNS, qué es una concesión y cómo resolver fallos de conexión.

What is DHCP and why does your computer receive an IP automatically?

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 writing 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 an available 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 provide 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:

  1. Discover: asks if there is any DHCP server available.
  2. Offer: a server offers a configuration.
  3. Request: the client requests to use the chosen configuration.
  4. Acknowledgment (ACK): the server confirms the assignment.

Sometimes you will see it abbreviated as DORA, from the four English words. It is not necessary 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 they gave me mine forever?

Not necessarily. DHCP usually delivers the address via 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 once 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 may 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 proper response from DHCP.

The possible causes include a DHCP server being turned off, a misconfigured network, traffic filtering, a faulty cable, or a client problem. Before changing options at random, check what address the device obtained and if it can communicate with its router.

What does it have to do with a VPS?

In virtual networks, address assignment mechanisms are also common. When managing VPS and containers from ArduMaker, understanding DHCP helps distinguish an IP configuration problem from a web server problem.

In an environment with multiple containers, it is not advisable for two devices to use the same address by accident. Network planning is as important as installing applications.

In short: DHCP is what helps assign addresses and network parameters without you having to configure them manually every time. When you cannot connect, understanding what it gave you is one of the first useful clues.

Sources: RFC 2131: DHCP protocol · Network configuration in Ubuntu Server · What is an IP and how it works.

What is DHCP and why does your computer receive an IP automatically?
  • DHCP
  • dirección IP
  • redes
  • router

Keep reading

All articles · VPS plans