Prevent IP Addresses from Rotating in DHCPD.conf (Non-Static)

Abstract: Prevent DHCP lease rotation by assigning a fixed IP address to a specific MAC address using host declarations in dhcpd.conf.

Created: 2026-10-04 by
To stop IP address rotation in ISC DHCP, you must assign a specific MAC address to a fixed IP using the host declaration block within your dhcpd.conf file. This method ensures that a client always receives the same lease regardless of the subnet's dynamic pool configuration. By binding the hardware address directly to an IP via the hardware ethernet and fixed-address directives, you override the default random assignment behavior for that specific device.

Understanding DHCP Lease Rotation

By default, the DHCP server manages a pool of available IP addresses and assigns them to clients as they request connections. When a client disconnects or its lease expires, the IP is returned to the pool and may be assigned to a different machine next time it connects. This process is known as lease rotation or dynamic assignment. While this is efficient for general networks where devices change frequently, it causes issues for servers, printers, or network infrastructure components that require a consistent network identity.

The solution lies in creating static reservations within the DHCP configuration. Unlike a true static IP configured on the network interface card (NIC) itself, a DHCP reservation keeps the IP management centralized in the server configuration. This approach allows you to maintain a single source of truth for all IP assignments while preventing specific devices from receiving changing addresses. For more context on managing multiple interfaces, you might find Configuring Multiple IPs on eth0 for NIC Testing useful for understanding broader networking setups.

Locating the Configuration File

The primary configuration file for the ISC DHCP server is typically located at /etc/dhcp/dhcpd.conf. On some distributions, such as older versions of Debian or Ubuntu, it might be found in /etc/dhcp3/dhcpd.conf. You need root access to edit this file, so use a text editor like nano or vim with sudo privileges.

sudo nano /etc/dhcp/dhcpd.conf

Before making changes, it is best practice to create a backup of the original file. This allows you to revert changes if a syntax error prevents the DHCP service from starting. Run the following command to copy the current configuration:

sudo cp /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.backup

Once backed up, open the file for editing. The structure of the file generally consists of global declarations, subnet declarations, and host declarations. Your new static assignment will go inside a host block.

Constructing the Host Declaration

To prevent rotation, you must identify the client by its unique MAC address and assign it a fixed IP. The syntax requires a host block containing the hardware ethernet directive and the fixed-address directive. You can name the host block anything descriptive, such as the hostname of the client or a comment describing its function.

First, determine the MAC address of the client machine. On Linux, you can find this by running ip link show or ifconfig -a. The MAC address format is usually six pairs of hexadecimal digits separated by colons (e.g., 00:11:22:33:44:55). Ensure you use the correct interface identifier, typically eth0, enp0s3, or similar, depending on your system's naming convention.

Next, add the following block to your dhcpd.conf file. Place this block outside of any subnet declaration blocks, typically at the end of the file or after the global options section:

host my-server {
    hardware ethernet 00:11:22:33:44:55;
    fixed-address 192.168.1.100;
}

In this example, replace my-server with a meaningful name, update the MAC address to match your target device, and set the fixed-address to the IP you wish to reserve. This IP must fall within the range of the subnet defined in your configuration but should ideally be outside the dynamic pool range to avoid conflicts, although modern DHCP servers handle overlap gracefully by prioritizing reservations.

Validating and Applying Changes

After saving the file, you must verify the syntax before restarting the service. An incorrect configuration will cause the DHCP daemon to fail to start, potentially leaving your network without IP assignment services. Use the dhcpd command with the -t flag for testing:

sudo dhcpd -t

If the test passes, you will see no output or a success message. If there are errors, the command will display the line number and description of the problem. Correct any syntax issues, such as missing semicolons or mismatched braces, and re-test.

Once validated, restart the DHCP service to apply the changes. The command varies by distribution:

# For systemd-based systems
sudo systemctl restart isc-dhcp-server

# For older SysVinit systems
sudo service dhcpd restart

Restarting the service forces the server to reload the configuration file. Existing leases are maintained unless the lease database file is also cleared, but new requests from the specified MAC address will immediately receive the fixed IP.

Managing Lease Files

The DHCP server stores active leases in a file, typically /var/lib/dhcp/dhcpd.leases. If a client previously obtained a dynamic IP and then you configure a reservation, the old lease might persist until it expires. To force immediate application of the new static IP, you can clear the lease file for that specific entry or delete the entire lease file and restart the server. Note that deleting the lease file removes records for all clients, which may cause temporary network disruption as clients renegotiate their addresses.

For environments involving virtual machines, resolving static IP issues can be tricky due to generated MAC addresses. If you are working with KVM or QEMU, check out KVM/QEMU: Resolving Static IP Address Assignment Issues with TAP Devices for insights on handling virtual network interfaces.

Frequently Asked Questions

What happens if I assign two hosts the same MAC address?

The DHCP server will likely assign the IP to whichever client requests it first or based on the order of processing in the config file. This creates unpredictable behavior and network conflicts. Always ensure each reservation has a unique MAC address.

Can I use a hostname instead of a MAC address?

No, DHCP relies on Layer 2 identifiers like MAC addresses for precise client identification. Hostnames are negotiated after the IP is assigned and are not reliable for initial reservation because they can be spoofed or changed easily by the client OS.

Does this method work for IPv6?

The concept is similar but uses different syntax. For IPv6, you would use the duid (DUID) or ia-na statements along with fixed-address in an host block, though many administrators prefer SLAAC or DHCPv6 prefixes for IPv6 static assignments.

Why does my client still get a different IP after configuring a reservation?

This often happens if the client has an old lease cached locally. You should renew the IP address on the client side (e.g., dhclient -r followed by dhclient) or wait for the existing lease to expire so the server can issue the new fixed address.

Is it better to use DHCP reservations or static IPs on the device?

DHCP reservations are generally preferred because they keep all IP management in one central location. If you move a device to a different physical port or subnet, you only need to update the server config rather than logging into every individual device to change its network settings.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More