Create a DHCP and DNS server with RedHat/ CentOS Linux

#yum -y install bind bind-utils dhcp


Tell what interface to use with dhcpd:   /etc/sysconfig/dhcpd



In /etc/named.conf add: (Modify to suit the following)

allow-query     { any; };

allow-recursion {any; };

listen-on port 53 {; };


Add this zone near the bottom:


zone “dhcpserver” IN {

type master;

file “dhcpserver”;

allow-update { any; };

notify no;



Create /var/named/dhcpserver:


@       IN      SOA     dhcpserver. hostmaster.dhcpserver. (

2012080701      ; Serial

43200      ; Refresh

3600       ; Retry

3600000    ; Expire

2592000 )  ; Minimum

;       Define the nameservers and the mail servers

IN      NS      dhcpserver.

IN      A

ns            IN      A

www        IN      A

client        IN      A

gateway        IN      A


Only have this in /etc/dhcp/dhcpd.conf:


subnet netmask {

option routers        ;

option subnet-mask    ;

option domain-name              “dhcpserver”;

option domain-name-servers;

option time-offset              -18000;     # Eastern Standard Time




#chkconfig named on

#chkconfig dhcpd on

#service named start

#service dhcpd start