You are on page 1of 10

DNS Server Setup using Bind

on CentOS 5.8

Prof Jeong Chul


tland12.wordpress.com

Computer Science
ITC and RUPP in Cambodia

DNS Server Setup using bind


on CentOS 5.8

Part I General DNS Server features

Part II DNS Server Security

DNS Server Setup using bind


on CentOS 5.8 Part I

Step 1 Package installation and service start

Step 2 Zone creating

Step 3 More domains adding

Step 4 Server load balancing (Round robin)

Step 5 Master and Slave nameserver

Step 6 client tools usage

Step 1 Package installation & service start


1. Package installation
bind-libs-9.3.6-20.P1.el5_8.4
bind-9.3.6-20.P1.el5_8.4
bind-utils-9.3.6-20.P1.el5_8.4
bind-chroot-9.3.6-20.P1.el5_8.4
caching-nameserver-9.3.6-20.P1.el5_8.4
2. Service start
# service named start
3. Service checking
# ps ef | grep named
# netstat nat | grep 53
4. Logfile checking
# tail f /var/log/messages
5. Runlevel registration
# chkconfig named on
# chkconfig list named

Step 2 Zone creating


1. Zone file
/var/named/chroot/etc/named.rfc1912.zones
2. Database file
/var/named/chroot/var/named/example.zone
# chown root.named example.zone
3. Configuration file (/var/named/chroot/etc/)
# cp named.caching-nameserver.conf named.conf
# chown root.named named.conf
4. Testing
# cat /etc/resolv.conf
nameserver 192.168.80.25
# service named restart
# host a example.com

Step 3 More domain adding


1.Zone file editing
/var/named/chroot/etc/named.rfc1912.zones
2.Database file for new domain
/var/named/chroot/var/named/google.zone
3.Testing
# host a google.com

4. Syntax checking using named-checkconf and namedcheckzone


#named-checkconf /etc/named.conf
#named-checkzone google.com google.zone

Step 4 Server Load Balancing


(Round robin)
1.In Zone database file (/var/named/chroot/var/named/example.com)
www IN
A
192.168.80.10
www IN
A
192.168.80.5
www IN
A
192.168.80.15
2.Testing
# ping c3 www.example.com
# ping c3 www.example.com
3.CNAME
ftp
IN

CNAME www

Step 5 Master and Slave nameserver


1.Mater server
zone "example.com" IN {
type master;
file "example.zone";
allow-update { none; };
allow-transfer { slave-ip; };

2.Slave server
zone "example.com" IN {
type slave;
file "slaves/example.zone";
masters { master-ip; };
allow-update { none; };
3.Testing on Slave server
# service named restart
# dig @master domain ns
# service named restart
# ls l /var/named/chroot/var/named/slaves

Step 6 client tools usage


1.Nslookup
#nslookup domain
set q=any
domain
2.Host
#host a domain
3.dig
#dig @nameserver domain type

DNS Server Setup using bind


on CentOS 5.8 Part 1

Thank you!!

You might also like