Configure a DNS Server (Bind Server)

We have to configure there are two type of DNS Servers

1. SDNS (Static Domain Name System)

2. DDNS (Dynamic Domain Name System)

Configure DNS Master and Slave

1. (M/S) Check the necessary RPM’s

#rpm –q bind caching-nameserver system-config-bind

2. (M/S) Set the public domain name, set the local loopback IP as the primary DNS server IP, set the ISP’s DNS server IP as the secondary DNS server IP to resolved domain name that does not belong to our domain and set the default gateway to access ISP’s DNS servers.


Edit a Device params à eth0 à Default gateway (Router LAN IP) à Ok à Save à Edit DNS Configuration à Primary DNS ( à Secondary DNS (Router LAN IP, to access ISP DNS) àSearch ( – Registered Domain) à Ok à Save and Exit

#service network restart

Check the Configuration

· Default Gateway

#cat /etc/sysconfig/network-script/ifcfg-eth0


#cat /etc/resolv.conf

3. (M) only on the master server

Create a DNS Zone file that contains all the information about your domain

Zone File Location à /var/named

Zone File Name à any name (ex –

#cd /var/named

#ls –l


Download sample DNS Zone file – download

4. (M/S) Now we have to authorized the zone file that we created for our domain

Copy the authorization configuration file in to the /etc folder

#cd /usr/share/system-config-bind/profiles/default

#ls –l

#cp named.conf /etc

#ls –l /etc/named.conf

· Edit the authorization configuration file on master DNS

#nano /etc/named.conf

Go to end of file, but before the final line


zone “” IN {

type master;

file “”;

allow-transfer {;; }; //First Slave Server IP and Second Slave Server IP


· Edit the authorization configuration file on Slave Servers

#nano /etc/named.conf

Go to end of file, but before the final line


zone “” IN {

type slave;

file “slaves/”; //Backup location (/var/named/slaves)

masters {; }; //Master Server IP


· Download the root DNS server information file so our DNS server can communicate with the root DNS Servers

#cd /var/named


#la –l

#cat named.root |more

5. (M/S) First in master then in slave

Start the DNS Service

#service named start

#chkconfig named on

6. (S) Check the slave servers to see wither the zone file has been properly backup

Only on the slave server

#cd /var/named/slaves

#ls –l


7. Setting up DNS Clients

Go to TCP/IP Properties

Preferred DNS – //Master Server IP

Alternate DNS – //Slave Server IP

More DNS servers can be set through ADVANCED button

IF Linux

#nano /etc/resolv.conf

nameserver //Master Server IP

nameserver //Slave Server IP

nameserver //Slave Server IP

8. Checking DNS



If you are going to implement multiple services on a single machine rather than using a single IP better to assign different IP’s to each and every service

How to assign multiple IP’s to a machine running with Linux


Edit a device params à New device à Ethernet à Add à Name : eth0:0 à Device : eth0:0 à DHCP : Cant use DHCP à Static IP : à Net mask : à Default Gateway : not necessary à Ok à Save à Save and Exit

#service network restart

#ifconfig |more

· To stop a network device

#ifdown eth0:0


· To start a network device

#ifup eth0:0


9. (M) Now we can assign the new IP’s to services using DNS

On Master DNS

#nano /var/named/

www IN A

sales IN A

mail IN A

ftp IN A

Increase the serial by one, save and exit

· Restart DNS

#killall named

#service named start

· Check DNS