In this post, i will show you on how to configure Bind Chroot DNS Server on CentOS 6.2. Assumed that you have installed Bind Chroot DNS.
1. Install Bind Chroot DNS Server
[root@centos62 ~]# yum install bind-chroot -y
2. Create a file /var/named/chroot/var/named/ehowstuff.local with the following configuration:
[root@centos62 ~]# vi /var/named/chroot/var/named/ehowstuff.local
;
; Addresses and other host information.
;
@ IN SOA ehowstuff.local. hostmaster.ehowstuff.local. (
2011030801 ; Serial
43200 ; Refresh
3600 ; Retry
3600000 ; Expire
2592000 ) ; Minimum
; Define the nameservers and the mail servers
IN NS ns.ehowstuff.local.
IN A 192.168.1.44
IN MX 10 mail.ehowstuff.local.
mail IN A 192.168.1.42
ns IN A 192.168.1.44
3. Generate an RNDC key :
The rndc tool is used to managed the named daemon. We need to generate a keyfile called /etc/rndc.key which is referenced both by /etc/rndc.conf and /etc/named.conf To do this we use the following command;
[root@centos62 ~]# rndc-confgen -a -c /etc/rndc.key wrote key file "/etc/rndc.key"
View the content of the RNDC key :
[root@centos62 ~]# cat /etc/rndc.key
key "rndc-key" {
algorithm hmac-md5;
secret "T6tduqyMQ/YbIDXOmE0Fzg==";
};
4. Edit the /var/named/chroot/etc/named.conf file for ehowstuff.local
[root@centos62 ~]# vi /var/named/chroot/etc/named.conf
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
forwarders { 8.8.8.8; };
};
include "/etc/rndc.key";
// We are the master server for ehowstuff.local
zone "ehowstuff.local" {
type master;
file "ehowstuff.local";
};
5. Start the DNS service using the following command :
[root@centos62 ~]# /etc/init.d/named start Starting named: [ OK ]
6. Make named daemon auto start during boot :
[root@centos62 ~]# chkconfig named on
7. Before testing, make sure your pc or server using the Bind Chroot DNS Server that has been set up :
[root@centos62 ~]# cat /etc/resolv.conf nameserver 192.168.1.44
8. Test your DNS service :
[root@centos62 ~]# host -t mx ehowstuff.local ehowstuff.local mail is handled by 10 mail.ehowstuff.local. [root@centos62 ~]# host -t ns ehowstuff.local ehowstuff.local name server ns.ehowstuff.local.
Technology Updates, Blogging Tips and How To Guides
Lyrics Collection, Upcoming and Released Albums and Movie Trailers
My Highly Recommended
Watch TV Online, Online TV Channels, Free TV Streaming, Free Internet TV
Professional WordPress Themes and Blogspot Templates Resources
Submit URL for Free, Search Engine Submission, Free URL Submission, Submit URL to Search Engine

Sign up for our daily email newsletter:

Pingback: does not answer queries over tcp and udp in name sever(centos)
Pingback: Setup DNS Server Bind chroot Centos 6.2 « Bachem's Blog