Nowadays, my favorite devices and technologies are the ones that just work. Sure, maybe I'm just lazy — okay, I'm definitely lazy, but having things just work isn't too much to ask. For example, every microwave I've ever owned has just worked. No troubleshooting, no fidgeting, they just heat up my frozen burritos and pizza rolls without fail, like a boss. Another great example, at least in my experience, is DHCP servers. While DHCP servers are nothing like microwave ovens and they're terrible for heating up hot pockets, they tend to be pretty reliable and don't require a lot of attention. They mainly just sit there, handing out IP addresses quietly in the background.
However, even though it probably won't happen often, there may come a time where you need to adjust some DHCP settings. One of the more common things you may need to change is your DHCP lease time, and if you haven't touched your DHCP server in a while, you may need a refresher course on how to do it. Worry not; we've got you covered. Follow along as we take a look at how to change the lease duration for your DHCP clients.
Let's get this question out of the way first. DHCP, which stands for dynamic host configuration protocol, is a networking protocol designed to automate the distribution of network configuration settings to devices. A DHCP server distributes IP addresses from a pool of available addresses and leases them to hosts.
Back in the '70s, when personal computers were first becoming a thing, users had to manually configure their device's network settings. As you can imagine, doing this for one computer is not a big deal. However, the problem escalates when you think about the large number of devices that companies were starting to acquire at that time.
To accommodate this growth, BOOTP (Bootstrap Protocol) was introduced in the '80s. BOOTP servers could automatically assign network configuration information to devices. However, BOOTP servers still required a lot of administration. In order for a host to receive its network configuration settings, its MAC address had to be manually added to the BOOTP server's database by an administrator. Additionally, the configuration information being sent out was static and couldn't be updated dynamically.
Jump another ten years to the '90s, and DHCP was developed. DHCP brought with it many quality of life improvements, including dynamically assigning network addresses, non-permanent address leases, and the ability to reclaim expired address leases. It also removed the need to maintain MAC address listings on the server. In fact, DHCP was so awesome that it really hasn't drastically changed since it was first developed.
The DHCP lease time is the mechanism that allows DHCP servers to reclaim IP addresses, preventing IP addresses from permanently being retained by a host.
When a DHCP server sends an IP address to a device, it is sent with a lease time. The lease time is the amount of time before the DHCP server will reclaim an IP address if the lease expires. Once an IP address is reclaimed, it can be re-assigned to another host.
Here's how the lease and renew process works between a host and the DHCP server. Halfway into a lease, hosts can request to renew their lease time. For example, if a DHCP server assigns an IP address to a host with an 8 day lease period, the host can request to renew the lease after 4 days, restarting the lease period. This process will continue until the host doesn't contact the server to renew the lease. This could happen if the host is offline for an extended period of time or if the host is unable to contact the DHCP server. Once the 8 days have passed, the DHCP server will reclaim the IP address making it available to be re-assigned.
Thankfully, changing the lease time on a DHCP server is pretty easy. Here's how to do it.
Open up Server Manager on your DHCP server. Server Manager can usually be found in the list of apps in the start menu or on the taskbar of your server.
With Server Manager open, click Tools > DHCP.
With the DHCP management console window open, expand your DHCP server and IPv4 menu items.
Click on the scope you want to change the lease time for, then right-click it and click Properties.
The scope properties window will open up. Make sure you're General tab. At the bottom, you should see the Lease duration for DHCP clients section. Make sure Limited to is selected, and then set the days, hours, and minutes for your lease time.
When you are finished, click Apply and OK. That's all there is to it. Make sure you do this for each scope as needed.
DHCP lease time best practices are a bit tricky. There's no one-size-fits-all solution that will work for every organization. Many factors should be considered, including the type of devices on the network, device mobility, IP address availability, etc. However, here are some general guidelines that should help you choose a lease time that works best for your network:
It's common to lengthen the DHCP lease time on networks primarily consisting of non-mobile devices, such as workstations. In these scenarios, an 8 day lease period is pretty standard. This will help reduce unnecessary DHCP network traffic.
If your network includes a large number of mobile devices, you may want to leave your DHCP lease period to 1 day or perhaps shorten it to about 8 hours. Shortening the lease period will ensure that mobile devices only periodically on the network do not retain IP addresses for an extended period.
If you provide publicly accessible network connectivity, consider setting your DHCP lease duration to 1 hour or even 30 minutes. Devices that constantly join and leave the network will quickly consume available IP addresses in these environments. A short lease period will ensure IP addresses are reclaimed quickly.
Another reason to shorten your lease length is if your network has a limited range of IP addresses available. If you can't increase the size of your subnet to add more IP addresses, a shorter lease period will help ensure IP addresses remain available.
Changing your DHCP lease time is very straightforward. However, finding the best lease time for your network may take more work. Play around with your lease schedule until you find what works best for your organization and while you're adjusting these settings, keep an eye on your available IP addresses for each subnet. It's always best to keep a healthy amount of IP addresses available if possible.