Sunday 30 November 2014

How to configure DNS Server in Chroot envirment with more than one domains

How to configure DNS Server in Chroot envirment with more than one domains

(1)    Give static IP to your server.

[root@Server data]#  cd /etc/sysconfig/network-scripts/
[root@Server network-scripts]# ls
ifcfg-eth0      ifdown-eth    ifdown-post    ifdown-tunnel  ifup-ippp   ifup-plip    ifup-sit          net.hotplug
ifcfg-eth0.bak  ifdown-ippp   ifdown-ppp     ifup           ifup-ipsec  ifup-plusb   ifup-sl           network-functions
ifcfg-lo        ifdown-ipsec  ifdown-routes  ifup-aliases   ifup-ipv6   ifup-post    ifup-tunnel       network-functions-ipv6
ifdown          ifdown-ipv6   ifdown-sit     ifup-bnep      ifup-ipx    ifup-ppp     ifup-wireless

ifdown-bnep     ifdown-isdn   ifdown-sl      ifup-eth       ifup-isdn   ifup-routes  init.ipv6-global

[root@Server network-scripts]# vim ifcfg-eth0














[root@Server data]# /etc/init.d/network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:                                [  OK  ]



(2)    Install  bind , caching-nameserver packages by yum server.

[root@Server network-scripts]# yum install bind*
[root@Server network-scripts]# yum install caching-nameserver

(3)    Open /etc/named.conf file make the changes as per below file

[root@Server network-scripts]# vim /etc/named.conf






















(4)    Copy localhost.zone file to zone.com & rev_192.168.1

[root@Server data]# cp /var/named/localhost.zone   /var/named/chroot/var/named/data/zone.com
[root@Server data]# cp /var/named/localhost.zone   /var/named/chroot/var/named/data/ rev_192.168.1

[root@Server network-scripts]# cd /var/named/chroot/var/named/data/

[root@Server data]# ls
rev_192.168.1  zone.com

(5)    Make changes in file zone.com and rev_192.168.1 file as per below file .

[root@Server data]# vim  zone.com






















[root@Server data]# vim rev_192.168.1





















(6)    Change permissions of the files

[root@Server data]# chown named.named /var/named/chroot/var/named/data/rev_192.168.1
[root@Server data]#   chown named.named /var/named/chroot/var/named/data/zone.com


(7)    Restart the service named

[root@Server data]# /etc/init.d/named restart
Stopping named:                                            [  OK  ]
Starting named:                                            [  OK  ]



(8)    Make entry of DNS server in resolv.conf file

[root@Server data]# vim /etc/resolv.conf






















(9) Check the the DNS Server Working  

[root@Server data]# nslookup www.google.com

Server:                 192.168.1.2
Address:              192.168.1.2#53

Address: 192.168.1.2


[root@Server data]# nslookup 192.168.1.2
Server:                 192.168.1.2
Address:              192.168.1.2#53

2.1.168.192.in-addr.arpa               name = www.google.com.


[root@Server data]# nslookup www.facebook.com
Server:                 192.168.1.2
Address:              192.168.1.2#53

Address: 192.168.1.2