Skip to main content

DHCP (Dynamic Host Configuration Protocol). Most of us know that a DHCP server is used to assign, and manage/track, IP addresses to the various devices on our network. Without a DHCP server, we would have to manually set, and track, a unique IP address for every device on our network, as well as set the proper network mask, DNS servers, and a default gateway address. This is fine for a very small/home network of devices, that never change – but even our homes today have more devices than small offices used to, and when our friends visit, with their cell phones, tablets, and portables, we don’t want to manually set those up each time – do we?

You might be saying right now, “I already have a DHCP server, on my router, and it works just fine. I don’t need to read this article, or go through the effort of setting up a linux DHCP server.”. Don’t be so quick to run away. You may be missing out on computing options you didn’t even know were available to you – and I’m sure your router DHCP server doesn’t implement all of the RFC 2131 protocol options.

As with any new service, you will need to install the DHCP Server software in order to get started. You can refer to our article which covers installing and configuring a DHCP Server in Ubuntu. DHCP is a very low memory, and CPU, usage service, so you don’t need to dedicate a computer for this. I would suggest a Raspberry-pi, or a virtual machine on a Linux computer/server that is doing other things (but isn’t your gaming computer).

Once you have decided where to run your DHCP service from, and installed the software which is provided by your distribution, it is time to examine the dhcpd.conf (DHCP Server Configuration File). This file is where we tell DHCP which IP addresses to use, which network interface to listen on, how long to issue the IP address for, and many other options.

Let’s have a deep look at some of these options (including some of the lesser known/used ones):

The default location for the DHCP Server configuration file is /etc/dhcp/dhcpd.conf.

Local vs Global/Default Options

One thing to mention is the organization of options for your DHCP Server. There are 2 types of options, local and global.

What’s the difference?
Global options are placed outside of your subnet blocks whereas local options are defined within each subnet block and override the default/global.

If you need an option to apply to all of your networks then you would want to setup a global option that will be outside of your subnet blocks. If you want an option to apply only to one or specific network, then you would want to place those options in the respected subnet block.

DNS Name Servers

It is extremely important to specify your domain name and DNS Servers in the config so your clients can have a way to resolve addresses automatically.

option domain-name "myhome.local";
option domain-name-servers,;

NTP Time Servers

Set the servers for the clients to contact to synchronize their system clocks. This can help facilitate computers and devices on your network to automatically pickup the correct time zone so you don’t have to manually change the time on each device.

option ntp-servers,;

Lease Times

The lease time for an IP address to each client is set to 600 seconds (or 10 minutes). Give some thought to this value, as lower numbers will cause a slight increase in network traffic, but a very high number would reduce the number of available IP addresses to new devices, if a device which left the network were given an IP address for several days.

default-lease-time 600;
max-lease-time 7200;

Dynamic DNS

If you are managing a local DNS server in this environment, you may want the DNS entry for a device to be updated automatically, when it is assigned an IP address (or the address changes).

ddns-update-style none;


If this DHCP server is the official DHCP server for the local network, the authoritative directive should be uncommented.


Custom Log File

Use this to send dhcp log messages to a different log file (you also have to hack syslog.conf to complete the redirection).

log-facility local7;


Here, we exclude the first 9 IP addresses from the range so that they can be used by dedicated (statically assigned) devices.

subnet netmask {
  option domain-name-servers dns.myhome.local;
  option domain-name "myhome.local";
  option routers;
  option broadcast-address;
  default-lease-time 600;
  max-lease-time 7200;


This static address is for a PXE (Preboot Execution Environment) service which can be used for booting devices from the network, for diagnostics tools, installation, and diskless terminals (like the LTSP (Linux Terminal Server Project –

host pxe {
  hardware ethernet 0:0:ab:dd:ee:ab;


This static address is for a kiosk (LTSP device) which will boot from the network, and run a GUI interface and web browser. These have many uses, but you can think of them as a “smart device” in your home network.

host kiosk {
  hardware ethernet 0:0:c0:6d:aa:ff;
  filename "ltsp/ltsp.pxe";

Now that you have your dhcpd.conf file they way your want/need it, you will need to start the DHCP Server service. Before you do that though, you must first disable any DHCP server that is already running on your network (like on your router). Once that has been disabled on your router, start the service (refer to the installation guide you may have followed earlier for instructions on how to start the service).

If your network is large enough to require multiple subnets, you will have to do some planning in order to accomplish this. Remember, there can only be one “authoritative” DHCP server on any network. To accomplish having multiple subnets on your network, your network will need to be segmented in some way. Options include:

  • Multiple network interfaces on your DHCP server, each network interface serving one subnet, and each network interface plugged into a separate physical network (switch, router).
  • Multiple network interfaces on your DHCP server, each network interface configured to tag for a different VLAN, and plugged into a switch/router which supports (and is configured for) the corresponding VLAN tags
  • or, utilize VLAN tagging on your switches/routers, and use a DHCP-Relay / IP-Helper (if your switch/router supports it). Here is an example on a Cisco switch (assuming the IP address of the DHCP server is and the the dhcp subnet/scope you want assign over this VLAN is
interface Vlan2
description Wired CLients on 10.2.2
ip helper-address

There are many, many more DHCP Server options which you may want to investigate, depending upon your needs, but I hope this article enabled you to think beyond a simple setup and encourage you to try other options, and technologies, in your lab environment, home, or office.

Leave a Reply