How to Install and Configure DHCP Server on Ubuntu Server 12.04 LTS

In How To 1392 views

This is a guide will explain how to install and configure dhcp server on Ubuntu server 12.04 LTS. The Dynamic Host Configuration Protocol (DHCP) is a network service that enables host computers to be automatically assigned settings from a server as opposed to manually configuring each network host. Computers configured to be DHCP clients have no control over the settings they receive from the DHCP server, and the configuration is transparent to the computer’s user.

The most common settings provided by a DHCP server to DHCP clients include IP address and netmask, IP address of the default-gateway to use and  IP adresses of the DNS servers to use.DHCP server can also supply configuration properties such as: Host Name, Domain Name, Time Server and  Print Server 

Follow the step-by-step installing and configure DHCP Server on Ubuntu Server 12.04 Precise pangolin

On this case I’ll using Ethernet device: eth0 with :

  • IP Address range: –
  • Subnet address:
  • Netmask:
  • Domain: preciseserver.public
  • Gateway Address:
  • Broadcast Address:
  • DNS Servers: and (OpenDNS )

Step 1. install DHCP server package

sudo apt-get install isc-dhcp-server

Step 2. Editing file /etc/default/isc-dhcp-server

sudo nano /etc/default/isc-dhcp-server

On line 11 of this file (Which is actually the last line because this file is basically empty) you will see the line:


Change this line to read:


# Defaults for dhcp initscript
# sourced by /etc/init.d/dhcp
# installed at /etc/default/isc-dhcp-server by the maintainer scripts
# This is a POSIX shell fragment
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".

Save and exit

Step 3. Editing file /etc/dhcp/dhcpd.conf

create backup /etc/dhcp/dhcpd.conf

sudo mv /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.original

Login as root

sudo -i

Create configuration file dhcpd.conf:

cat > /etc/dhcp/dhcpd.conf <<-EOF
option domain-name "preciseserver.public";
option domain-name-servers ns1.preciseserver.public, ns2.preciseserver.public;
default-lease-time 600;
max-lease-time 7200;
subnet netmask {
option domain-name-servers,;
option domain-name "serv.preciseserver.public";
option routers;
option broadcast-address;
default-lease-time 600;
max-lease-time 7200;

Step 4. restart dhcp server

sudo service isc-dhcp-server restart

Setup Dhcp Client on Ubuntu

To setup dhcp client on ubuntu open System Setting – Hardware – Network  – Select wired – Option – IPv4 Setting – On Method dropdown and select Automatic (DHCP)

Setup DHCP Client Ubuntu

Setup Dhcp Client on Windows

Control Panel – Network Connection – Right Click “Local Area Connection” – Properties – Tag General – Double Click “Internet Protocol (TCP/IP” – Select “Obtain an IP address automatically” and “Obtain DNS Server address automatically”

Setup Dhcp Client Windows XP

Reference :

Tags: #DHCP Client #DHCP Server #Ubuntu Server 12.04

How to Upgrade Ubuntu Server 12.04 to Ubuntu Server 14.04 LTS
How to Upgrade Ubuntu Server 12.04 to Ubuntu Server 14.04 LTS
This tutorial will describes how to upgrade
How to Setup OwnCloud Server 5 with SSL Connection
How to Setup OwnCloud Server 5 with SSL Connection
Today ownCloud is the best cloud storage
Must read×