What Is DHCP and How Does It Work?
Every time you use your computer or smartphone to go online, dynamic host configuration protocol (DHCP) is working in the background.
While you probably will not have to configure your DHCP settings unless you’re a network administrator, it’s still good to know what DHCP is and how it works.
In this guide to DHCP, we’ll cover:
- DHCP servers
- DHCP clients
- DHCP relay agents
- IP address pools and DHCP
- Why subnet masks matter for DHCP
- Lease time and DHCP
- Gateway addresses and DHCP
- The advantages of DHCP
- The disadvantages of DHCP
What is DHCP?
Before we talk about DHCP, we need to talk about public and private IP addresses. Also for more information you should check static and dynamic IP.
IP addresses are a string of numbers assigned to you when you go online. They work a lot like mailing addresses — they tell websites where to send data after you’ve requested it. You can read our full guide to IP addresses to go more in-depth.
When you set up an internet connection in your home, you usually pay for the service from an internet service provider (ISP). ISPs have whole databases of IP addresses that they can assign to their customers, and they will assign a public IP address to your home router or gateway. Your home router uses this IP address to receive and send information from the rest of the web.
But when you’re at home, you probably use multiple devices that are connected to the internet. If you’re like many households, you might have four people in your family with smartphones, three people with laptops, two people with tablets, a Roku, a PlayStation, your TV, and three light bulbs. In order for your router to send the Call of Duty data to your PS5 and the YouTube videos to your daughter’s tablet and not the other way around, it needs to know the address of each device. So, all your devices have a private IP address. This is in addition to the public IP address your router uses.
So what does this have to do with DHCP? Just wait; we’re getting there!
Only your public IP address has to be unique. Your various devices won’t keep the same IP address every time they access the internet, so they can basically “share” a pool of private IP addresses. Public websites like Google don’t need to know what your private IP address is; they just need to know your public address. Google sends the data to your public IP address, which is associated with your router. Your router then sends the data to the correct device on your network, because the router knows what all the private IP addresses for each device are at a given time (private IP addresses are dynamic and constantly changing).

That all makes sense, right? Okay, now we’re ready to explain DHCP.
At home, you have several devices with private IP addresses. It would be really annoying if you had to manually assign the IP address to your smartphone every time you wanted to use it, right? That’s why routers use DHCP. It helps internal networks, like your home network, assign and manage IP addresses for each of your devices.
Depending on the size of your household, you probably don’t have more than 10 devices connected to your home network at one time. Imagine a company that may have 100, 500, or even a thousand devices connecting to the same internal network. This is where DHCP becomes much more useful. Network administrators can use DHCP to set up time limits, so the same device doesn’t use the same IP address for more than a few minutes. They can also ensure that inactive devices aren’t using an IP address that can be given to someone else.
It makes managing an internal network a whole lot easier. The important thing to remember about DHCP is that it’s a protocol for internal networks. And it’s not used to assign public IP addresses but private ones. If your use case requires a fixed, internet-facing address, you may want to use a static public IP instead of relying on a changing assignment.
What is a DHCP server?
The DHCP server is one of the most important components of DHCP. In most home internet setups, the DHCP server is actually a router. It manages requests for IP addresses from the network and keeps a record of all the IP addresses it assigns and to which devices it assigns them. It also maintains an IP address pool to choose from.
The DHCP can tell different devices on the network apart using a media access control (MAC) address. The MAC address on each device is different, so it helps the DHCP server tell the devices apart. That way, no two devices get the same IP address.
DHCP is a client-server protocol — a way for humans to get information from websites. You are the client in this interaction, and you communicate with a DHCP server. Network admins use DHCP servers to set up rules for assigning clients (that’s you) an IP address. These rules could be:
- Specifying a gateway address
- Specifying a DNS server IP address
- Applying a subnet mask
- Specifying lease time
We’ll cover some of these rules in more detail in the below sections.
What is a DHCP client?
The client is one of the other main components in the DHCP process, apart from servers and relay agents. The client is you, or rather, your device. Your computer, phone, gaming console, refrigerator, cat food distributor, or any other gadget you have that connects to the internet is a client. The client can connect to the internal network and communicate with the DHCP server in order to get an IP address and go online.
The communication between the DHCP server and client is a very specific process known as a DHCP handshake. Here’s how it works:
- Discover: The client wants to connect to the internet and sends out a broadcast to find available DHCP servers.
- Offer: The DHCP server picks up the client’s broadcast and then responds with the available IP addresses and configuration options.
- Request: The client requests one of the offered IP addresses and sends out a request to other clients on the network, to see if any of them are already using the IP address it wants. If not, the client can take it.
- Acknowledgment: The DHCP server acknowledges the client’s request for information and sends a data packet that includes the lease duration (how long the client gets to keep the IP address) and any other information the client needs for using this IP address.

What is a DHCP relay agent?
A DHCP relay agent manages requests sent between DHCP clients and servers. In a typical household network, relay agents aren’t necessary as the number of devices going online is limited. They’re more useful in organizations with larger networks and a lot more devices, especially if they’re using a remote DHCP server. With all the requests going back and forth between DHCP clients and servers in a company setting, you need a go-between to keep things running efficiently.

What is an IP address pool?
An IP address pool is what it sounds like — a pool of IP addresses that are available to use within a network. A DHCP server manages an IP address pool so it knows which addresses it can allocate to a client when that client requests an IP address.
What is a subnet mask?
A subnet mask helps internet traffic get to its destination faster. It divides an IP address into two parts to identify which part is the host (or client) and which part is the network. A subnet mask also defines the range of IP addresses that can be used within a network or subnet.
To better understand this concept, it helps to know what a subnet is. A subnet is a network within a network — subnet is a shortened version of “subnetwork.” They help make large networks run more smoothly and allow traffic through the network to travel shorter distances to get to its destination.
You know how the shortest distance between two points is a straight line? Well, subnets help make the lines connecting nodes on a network a little straighter, allowing data to travel the most direct route possible.
Parts of an IP Address
To understand subnet masks, you should also know what the different parts of an IP address mean and what the different classes of IP addresses are.
In an IP address, some of the numbers indicate a network and some indicate a host or device. Because there are so many IP addresses, they’re broken up into categories or classes. There’s class A, B, C, D, and E, although D and E aren’t used much.
- Class A: Class A networks connect millions of devices and are usually reserved for governments and large companies. In class A IP addresses, everything before the first period indicates the network and everything after indicates the device. With 203.0.113.112, “203” is the network and “0.113.112” is the device.
- Class B: Class B networks are smaller than class A networks and are usually given to ISPs to assign to residential internet connections. A class B IP address indicates the network with everything before the first two periods. So with 203.0.113.112, “203.0” is the network and “113.112” is the device.
- Class C: Class C networks are the smallest and most numerous. They are usually reserved for individual devices. Everything before the third period is the network and everything after is the device. With the same example from above, “203.0.113” would be the network and “112” would be the device.
Subnets help internet routers find the right network to send their data to, especially in larger class A networks. But an IP address only indicates a network and a device, it doesn’t indicate a subnet. So how does the router know which subnet to go to? with this paragraph: One way to manage this is by configuring the subnet mask, which can change an IP address‘s way of identifying networks and devices, allowing routers to properly direct traffic to the correct subnet within a larger network.
Helping routers do their work
Now we can get to subnet masks.
Subnet masks help routers figure out which part of the IP address is the network and which part is the host. They’re like little codes written over the IP address (thus the “mask”) as a shorthand for the router.
When a router receives a data packet, it uses a subnet mask of 255.255.255.0, determines what the device address is, and then sends the data to the router associated with the proper subnet.
Think of it this way: You work in the marketing department at a large company. When someone sends you mail, the administrative team doesn’t take your mail directly to you. They take it to the marketing department, which then gives it to you. In this example, the marketing department is the subnet mask, and you are the IP address. It’s simply a way to speed up the process of getting data delivered to the right place.

What is lease time?
In a DHCP setup, lease time refers to the amount of time the DHCP server lets the client use a given IP address. When configuring the network, administrators can set a rule that a device can only have one IP address for a certain period of time before it has to get a new one. The DHCP server will adhere to this rule and when it sends an IP address to the client during the DHCP handshake, it will let the client know what the lease time is.
What is a gateway address?
A gateway address is also referred to as a default gateway. It’s like the door data has to go through when it passes out of your internal network and onto the internet. When you want to go to Google.com, for example, your request has to go to the default gateway first before leaving your local network. For most home networks that have one router with multiple connected devices, the IP address of your router is the default gateway IP address.
Essentially, your gateway and router are the same. It’s the first point of contact for your local network to receive any traffic that comes from an outside network.
It’s pretty easy to find your gateway address too, whether you’re on Windows or a Mac.
How to find your gateway address on Windows:
- Open your Control Panel.
- Click on Network and Internet.
- Click on Network and Sharing Center.
- In the Network and Sharing Center window, click on Ethernet.
- In the Ethernet window, click the box that says Details….
- In the list that pops up, your gateway address will be next the label IPv4 Default Gateway.
How to find your gateway address on Mac:
- Click the Apple icon at the top left of the screen.
- Select System Preferences.
- Click Network.
- Click on your network connection and then click Advanced.
- Click the TCP/IP tab.
- Your gateway address is listed next to the label Router.
Advantages of DHCP
DHCP certainly makes things easier for local networks. Some of the main benefits of DHCP are:
- Reliable configuration: Configuring IP addresses manually can lead to errors. For example, if you type the wrong number or assign the same number to two devices. Automating the process with DHCP reduces those errors.
- Less work for network admins: It would take a lot of time and resources for network administrators to manually configure IP addresses in large networks. DHCP makes things run more efficiently.
- Real-time modifications: Admins can make changes to DHCP options in a network even while the DHCP server is running and allotting IP addresses.
- It’s free: For most networks, implementing DHCP doesn’t come with any extra costs.
- Supports multiple devices on one network: DHCP allows you to connect to and surf the web on whichever device you choose and still have a seamless experience.
Disadvantages of DHCP
While DHCP is a basic function that most local networks need to operate smoothly, it does have some drawbacks. The average consumer doesn’t need to worry about them, but you may want to understand what they are.
- Security: DHCP servers have no way to authenticate clients that request IP addresses. So clients can gain access to unauthorized IP addresses by pretending to be a different client.
- Single point of failure: If a network has only one DHCP server and it fails, clients can’t gain access to the web.
- Required relay agents: DHCP servers must have relay agents to be able to communicate with the network because DHCP data can’t travel across the router.
- No static IP: Computers that are connected to a network with DHCP implemented can’t be used as servers because their IP address is always changing.
Tracing internet activity: Tracking internet activity is more difficult with DHCP in place because the same device may have two or more IP addresses over a given period of time.
Conclusion
DHCP is a crucial part of any local network, improving reliability and speeds by quickly managing data. The way IP addresses work now, you need DHCP to be able to browse the web on any device you want. It’s especially important for larger networks that have scores of different devices connecting and disconnecting at any given moment. DHCP is currently our best form of connecting devices to the networks we use every day.
Related Articles
- All
- Easy Prey Podcast
- General Tech Topics, News & Emerging Trends
- Home Computing to Boost Online Performance & Security
- IP Addresses
- Networking Basics: Learn How Networks Work
- Online Privacy Topics to Stay Safe in a Risky World
- Online Safety
- Uncategorized
A Former Fraudster’s Tips for Protecting Your Personal Information in a Connected World
Technology is evolving so fast and is ever increasingly integrated into our world. It’s becoming less and…
[Read More]Awareness and Safety Go Hand-in-Hand: Tips to Protect Yourself
Scams are often (though not always) technology-based, and physical danger happens in the physical world. But both…
[Read More]We Created EasyPrey.com Scam Help Page to Help You
WhatIsMyIPAddress.com and our sister website, EasyPrey.com, focus on providing content and links to information and resources for...
[Read More]EasyPrey.com Resources for Scam Victims
We’ve compiled a list of resources for all victims (and near victims) of scams, fraud, and identity…
[Read More]The BBB Scam Resources Are There to Help You!
The Better Business Bureau is on YOUR side, helping consumers with real-time scam tracking, which you can...
[Read More]Amazon Scams Come in All Shapes and Sizes. Are You Prepared?
Tell Amazon ASAP if you’re a victim of a delivery scam. Amazon takes fraud and scams quite...
[Read More]





