I have cloned Virtual box node and using it as my dns server
Hostname: racdns.charan.com
IP: 192.168.10.105
Step 1: Set the domain name in DNS server
As root user execute the below commands
domainname charan.com
domainname>/etc/defaultdomain
Step 2: Write the Zone information in /etc/named.conf
[root@racdns ~]# cat /etc/named.conf
options {
directory "/var/named";
};
zone "charan.com" {
type master;
file "charan.for";
};
zone "10.168.192.in-addr.arpa"{
type master;
file "charan.rev";
};
[root@racdns ~]#
Copy the file /etc/named.conf to /var/named/chroot/etc
Step 3: Configure forward and reverse lookup files
cd /var/named
[root@racdns named]# cat charan.for
@ IN SOA racdns.charan.com root.charan.com (
2010110101
36400
86000
108000
36000)
@ IN NS racdns.charan.com
rac1 IN A 192.168.10.100
rac1-vip IN A 192.168.10.200
rac2 IN A 192.168.10.101
rac2-vip IN A 192.168.10.201
cluster-scan IN A 192.168.10.108
cluster-scan IN A 192.168.10.106
cluster-scan IN A 192.168.10.107
[root@racdns named]#
[root@racdns named]# cat charan.rev
@ IN SOA racdns.charan.com. root.charan.com. (
2010110101
36400
86000
108000
36000 )
@ IN NS racdns.charan.com.
100 IN PTR rac1.charan.com.
200 IN PTR rac1-vip.charan.com.
101 IN PTR rac2.charan.com.
201 IN PTR rac2-vip.charan.com.
108 IN PTR cluster-scan.charan.com.
106 IN PTR cluster-scan.charan.com.
107 IN PTR cluster-scan.charan.com.
[root@racdns named]#
Copy these two files (charan.for and charan.rev) to /var/named/chroot/var/named/
Step 4: Start the named service
service named restart
Step 5: Make the named service autostart whenever server reboots
chkconfig named on
Please find the attachments in this page for the dns setup files
Configure DNS Client (On Both Nodes)
Step 1: Edit the file /etc/resolv.conf
#Enter the IP address of the DNS server
nameserver 192.168.10.105
domain charan.com
Step 2: Edit the file /etc/nsswitch.conf
There would be an entry for hosts in the format hosts : files dns change it to the format hosts : dns files
Now the hostname will be searched in dns server first rather than in host file entry
Regards,
Charan