Networking / Beginners

DHCPD Configuration

Now that you have basically installed and enabled ISC DHCPD, you should set up your configuration file carefully, before starting to use your brand new DHCP server. The configuration file contains general information about how your DHCP server should assign IP addresses, and what information it should offer to the clients.

ddns-updates off;
ddns-update-style ad-hoc;
option domain-name "";
option domain-name-servers,;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;

# Our Network
subnet netmask
	option routers;
	option subnet-mask;

The above example configuration file assigns dynamic IP addresses to hosts from subnet In fact, the server assigns from to (leaving a small subnet of the address space for static allocation). The DHCP server also advertises the as the default gateway for the network and also subnet mask to the clients. In addition, there are two DNS servers and the default domain name (in this case

According to our configuration, the default lease time for each address is 600 seconds (10 minutes), if the client does not request any specific lease time. The maximum possible lease time we have specified is 7200 seconds (2 hours). You may want to modify these parameters according to your network configuration and resources.

To keep track of assigned IP addresses, DHCP server maintains a lease file at /var/ db/dhcpd/dhcpd.leases. This is where DHCP server writes down the IP addresses assigned to each client, and whether the leases are active or inactive. The file also contains additional information about each client, such as MAC address. This address is used to identify unique hosts, as well as start and end times for leases and also the binding state field. This will be useful for a system administrator to see which systems are online and have active leases (by looking at binding state field) and which hosts are not online. You can also modify this file to remove inactive leases, or easily assign a specific IP address to each client. Removing this file will lead the DHCP server to lose track of its assignment history, and all the leases will be reset.

The following sample shows a dhcpd.leases file that contains two entries, the first entry for an expired (and reserved) address and the second entry for an active (currently assigned) IP address as shown here:

# cat /var/db/dhcpd/dhcpd.leases
      starts 0 2008/03/16 17:25:09;
      ends 0 2008/03/16 17:35:09;
      tstp 0 2008/03/16 17:35:09;
      binding state free;
      hardware ethernet 00:18:f3:03:f4:5b;
      uid "\001\000\030\363\003\364[";
      starts 0 2008/03/16 19:22:01;
      ends 0 2008/03/16 19:32:01;
      binding state active;
      next binding state free;
      hardware ethernet 00:a0:d1:3d:00:dd;
      uid "\001\000\240\321=\000\335";
      client-hostname "pixel";
[Previous] [Contents] [Next]