How to Install Bind Chroot DNS Server on Linux CentOS 5.7 Server

DNS is the Domain Name System that maintains a database that can help user’s computer to translate domain names such as www.ehowstuff.com to IP addresses such as 184.173.214.97. DNS on CentOS is based on the named daemon, which is built on the BIND package developed through the Internet Software Consortium. (More information is available from the BIND home page at www.isc.org/products/BIND.) In this post, i will guide you on how to install Bind Chroot DNS server on linux CentOS 5.7 server. This steps may working on other version such as CentOS 5.1, CentOS 5.2, CentOS 5.3, CentOS 5.4, CentOS 5.5 and CentOS 5.6.

1. Install Bind Chroot DNS Server on Linux CentOS 5.7 Server

[root@CentOS57 ~]# yum install bind-chroot -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.oscc.org.my
 * extras: mirror.oscc.org.my
 * rpmforge: ftp-stud.fht-esslingen.de
 * updates: mirror.oscc.org.my
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package bind-chroot.i386 30:9.3.6-20.P1.el5 set to be updated
--> Processing Dependency: bind = 30:9.3.6-20.P1.el5 for package: bind-chroot
--> Running transaction check
---> Package bind.i386 30:9.3.6-20.P1.el5 set to be updated
--> Processing Dependency: bind-libs = 30:9.3.6-20.P1.el5 for package: bind
--> Running transaction check
--> Processing Dependency: bind-libs = 30:9.3.6-16.P1.el5_7.1 for package: bind-utils
---> Package bind-libs.i386 30:9.3.6-20.P1.el5 set to be updated
--> Running transaction check
---> Package bind-utils.i386 30:9.3.6-20.P1.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                  Arch              Version                         Repository         Size
====================================================================================================
Installing:
 bind-chroot              i386              30:9.3.6-20.P1.el5              base               47 k
Installing for dependencies:
 bind                     i386              30:9.3.6-20.P1.el5              base              981 k
Updating for dependencies:
 bind-libs                i386              30:9.3.6-20.P1.el5              base              863 k
 bind-utils               i386              30:9.3.6-20.P1.el5              base              174 k

Transaction Summary
====================================================================================================
Install       2 Package(s)
Upgrade       2 Package(s)

Total download size: 2.0 M
Downloading Packages:
(1/4): bind-chroot-9.3.6-20.P1.el5.i386.rpm                                  |  47 kB     00:00
(2/4): bind-utils-9.3.6-20.P1.el5.i386.rpm                                   | 174 kB     00:01
(3/4): bind-libs-9.3.6-20.P1.el5.i386.rpm                                    | 863 kB     00:07
(4/4): bind-9.3.6-20.P1.el5.i386.rpm                                         | 981 kB     00:08
----------------------------------------------------------------------------------------------------
Total                                                               111 kB/s | 2.0 MB     00:18
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating       : bind-libs                                                                    1/6
  Installing     : bind                                                                         2/6
  Installing     : bind-chroot                                                                  3/6
  Updating       : bind-utils                                                                   4/6
  Cleanup        : bind-libs                                                                    5/6
  Cleanup        : bind-utils                                                                   6/6

Installed:
  bind-chroot.i386 30:9.3.6-20.P1.el5

Dependency Installed:
  bind.i386 30:9.3.6-20.P1.el5

Dependency Updated:
  bind-libs.i386 30:9.3.6-20.P1.el5                bind-utils.i386 30:9.3.6-20.P1.el5

Complete!

2. Check the DNS named service :

[root@CentOS57 ~]# service named status
rndc: connect failed: 127.0.0.1#953: connection refused
named is stopped

named daemon service is stop, You must configure the bind chroot before you start it.

How to Install and Configure Bind9 DNS on Ubuntu 11.10

Bind is the most popular software and the most widely used Domain Name System (DNS) software on the Internet for providing DNS services. The name BIND stands for “Berkeley Internet Name Domain” and it’s an implementation of the DNS protocols. In this post i will show the steps how to install and configure Bind 9 DNS service on Ubuntu 11.10 linux server.

1. Install Bind9 :

ehowstuff@ehowstuff:~$ sudo apt-get install bind9 -y

2. Setup and configure zone with the name of ehowstuff.local

ehowstuff@ehowstuff:~$ sudo vim /etc/bind/named.conf.local

Add a DNS zone to BIND9. Edit named.conf.local as below :

//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

zone "ehowstuff.local" {
             type master;
             file "/etc/bind/db.ehowstuff.local";
        };
~

3. Copy and Use an existing zone file as a template:

ehowstuff@ehowstuff:/etc/bind$ sudo cp /etc/bind/db.local /etc/bind/db.ehowstuff.local

Edit the new zone file db.ehowstuff.local.

ehowstuff@ehowstuff:~$ sudo vim /etc/bind/db.ehowstuff.local

Change configuration as below :

;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     ns.ehowstuff.local. root.ehowstuff.local. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns.ehowstuff.local.
ns      IN      A       192.168.1.49
box     IN      A       192.168.1.49

4. Any changes that you’ve made to the zone file BIND9 will need to be restarted before it to take effect:

 
ehowstuff@ehowstuff:~$ sudo /etc/init.d/bind9 restart
 * Stopping domain name service... bind9                                            [ OK ]
 * Starting domain name service... bind9                                            [ OK ]

5. Make sure you own workstation or server pointing to dns server. In this case, this Ubuntu server pointed to itself since it’s running bind9.

ehowstuff@ehowstuff:~$ sudo vim /etc/resolv.conf
nameserver 127.0.0.1

6. test your bind9 server :

ehowstuff@ehowstuff:~$ nslookup
> set type=ns
> ehowstuff.local
Server:         127.0.0.1
Address:        127.0.0.1#53

ehowstuff.local nameserver = ns.ehowstuff.local.

How to Install and Configure Bind 9 as a Caching Server on Ubuntu 11.10

Bind is the most popular software and the most widely used Domain Name System (DNS) software on the Internet for providing DNS services. The name BIND stands for “Berkeley Internet Name Domain” and it’s an implementation of the DNS protocols. In this post i will show the steps how to install and configure Bind 9 to act as a caching server on Ubuntu 11.10 linux server.

root@ehowstuff:~# apt-get install bind9 -y

Example :

root@ehowstuff:~# apt-get install bind9 -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  bind9-host bind9utils dnsutils libbind9-60 libcap2 libdns69 libisc62 libisccc60 libisccfg62
  liblwres60
Suggested packages:
  bind9-doc resolvconf rblcheck
The following NEW packages will be installed:
  bind9 bind9utils libcap2
The following packages will be upgraded:
  bind9-host dnsutils libbind9-60 libdns69 libisc62 libisccc60 libisccfg62 liblwres60
8 upgraded, 3 newly installed, 0 to remove and 56 not upgraded.
Need to get 1,592 kB of archives.
After this operation, 1,479 kB of additional disk space will be used.
Get:1 http://sg.archive.ubuntu.com/ubuntu/ oneiric-updates/main dnsutils i386 1:9.7.3.dfsg-1ubuntu4.1 [142 kB]
Get:2 http://sg.archive.ubuntu.com/ubuntu/ oneiric-updates/main bind9-host i386 1:9.7.3.dfsg-1ubuntu4.1 [53.9 kB]
Get:3 http://sg.archive.ubuntu.com/ubuntu/ oneiric-updates/main libisc62 i386 1:9.7.3.dfsg-1ubuntu4.1 [160 kB]
Get:4 http://sg.archive.ubuntu.com/ubuntu/ oneiric-updates/main libdns69 i386 1:9.7.3.dfsg-1ubuntu4.1 [676 kB]
Get:5 http://sg.archive.ubuntu.com/ubuntu/ oneiric-updates/main libisccc60 i386 1:9.7.3.dfsg-1ubuntu4.1 [18.0 kB]
Get:6 http://sg.archive.ubuntu.com/ubuntu/ oneiric-updates/main libisccfg62 i386 1:9.7.3.dfsg-1ubuntu4.1 [38.8 kB]
Get:7 http://sg.archive.ubuntu.com/ubuntu/ oneiric-updates/main liblwres60 i386 1:9.7.3.dfsg-1ubuntu4.1 [38.6 kB]
Get:8 http://sg.archive.ubuntu.com/ubuntu/ oneiric-updates/main libbind9-60 i386 1:9.7.3.dfsg-1ubuntu4.1 [23.0 kB]
Get:9 http://sg.archive.ubuntu.com/ubuntu/ oneiric/main libcap2 i386 1:2.21-2 [12.5 kB]
Get:10 http://sg.archive.ubuntu.com/ubuntu/ oneiric-updates/main bind9utils i386 1:9.7.3.dfsg-1ubuntu4.1 [102 kB]
Get:11 http://sg.archive.ubuntu.com/ubuntu/ oneiric-updates/main bind9 i386 1:9.7.3.dfsg-1ubuntu4.1 [327 kB]
Fetched 1,592 kB in 18s (88.4 kB/s)
Preconfiguring packages ...
(Reading database ... 50749 files and directories currently installed.)
Preparing to replace dnsutils 1:9.7.3.dfsg-1ubuntu4 (using .../dnsutils_1%3a9.7.3.dfsg-1ubuntu4.1_i386.deb) ...
Unpacking replacement dnsutils ...
Preparing to replace bind9-host 1:9.7.3.dfsg-1ubuntu4 (using .../bind9-host_1%3a9.7.3.dfsg-1ubuntu4.1_i386.deb) ...
Unpacking replacement bind9-host ...
Preparing to replace libisc62 1:9.7.3.dfsg-1ubuntu4 (using .../libisc62_1%3a9.7.3.dfsg-1ubuntu4.1_i386.deb) ...
Unpacking replacement libisc62 ...
Preparing to replace libdns69 1:9.7.3.dfsg-1ubuntu4 (using .../libdns69_1%3a9.7.3.dfsg-1ubuntu4.1_i386.deb) ...
Unpacking replacement libdns69 ...
Preparing to replace libisccc60 1:9.7.3.dfsg-1ubuntu4 (using .../libisccc60_1%3a9.7.3.dfsg-1ubuntu4.1_i386.deb) ...
Unpacking replacement libisccc60 ...
Preparing to replace libisccfg62 1:9.7.3.dfsg-1ubuntu4 (using .../libisccfg62_1%3a9.7.3.dfsg-1ubuntu4.1_i386.deb) ...
Unpacking replacement libisccfg62 ...
Preparing to replace liblwres60 1:9.7.3.dfsg-1ubuntu4 (using .../liblwres60_1%3a9.7.3.dfsg-1ubuntu4.1_i386.deb) ...
Unpacking replacement liblwres60 ...
Preparing to replace libbind9-60 1:9.7.3.dfsg-1ubuntu4 (using .../libbind9-60_1%3a9.7.3.dfsg-1ubuntu4.1_i386.deb) ...
Unpacking replacement libbind9-60 ...
Selecting previously deselected package libcap2.
Unpacking libcap2 (from .../libcap2_1%3a2.21-2_i386.deb) ...
Selecting previously deselected package bind9utils.
Unpacking bind9utils (from .../bind9utils_1%3a9.7.3.dfsg-1ubuntu4.1_i386.deb) ...
Selecting previously deselected package bind9.
Unpacking bind9 (from .../bind9_1%3a9.7.3.dfsg-1ubuntu4.1_i386.deb) ...
Processing triggers for man-db ...
Processing triggers for ufw ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
Setting up libisc62 (1:9.7.3.dfsg-1ubuntu4.1) ...
Setting up libdns69 (1:9.7.3.dfsg-1ubuntu4.1) ...
Setting up libisccc60 (1:9.7.3.dfsg-1ubuntu4.1) ...
Setting up libisccfg62 (1:9.7.3.dfsg-1ubuntu4.1) ...
Setting up libbind9-60 (1:9.7.3.dfsg-1ubuntu4.1) ...
Setting up liblwres60 (1:9.7.3.dfsg-1ubuntu4.1) ...
Setting up bind9-host (1:9.7.3.dfsg-1ubuntu4.1) ...
Setting up dnsutils (1:9.7.3.dfsg-1ubuntu4.1) ...
Setting up libcap2 (1:2.21-2) ...
Setting up bind9utils (1:9.7.3.dfsg-1ubuntu4.1) ...
Setting up bind9 (1:9.7.3.dfsg-1ubuntu4.1) ...
Adding group `bind' (GID 113) ...
Done.
Adding system user `bind' (UID 105) ...
Adding new user `bind' (UID 105) with group `bind' ...
Not creating home directory `/var/cache/bind'.
wrote key file "/etc/bind/rndc.key"
#
 * Starting domain name service... bind9                                                     [ OK ]
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

The main configuration is stored in the following files:

root@ehowstuff:~# ls /etc/bind | grep named
named.conf
named.conf.default-zones
named.conf.local
named.conf.options

To configure bind9 to act as a caching server, all that is required is simply adding the IP numbers of your ISP’s DNS servers or alternatively you can use free google dns server as below :

root@ehowstuff:~# vim /etc/bind/named.conf.options

Uncomment and edit the following in /etc/bind/named.conf.options :

.
.
.
    forwarders {
                8.8.8.8;
         };
.
.
.

Start or restart caching named service :

As a root :

root@ehowstuff:~# /etc/init.d/bind9 restart
 * Stopping domain name service... bind9                                                     [ OK ]
 * Starting domain name service... bind9                                                     [ OK ]

or restart bind as normal user :

ehowstuff@ehowstuff:~$ sudo /etc/init.d/bind9 restart
[sudo] password for ehowstuff:
 * Stopping domain name service... bind9                                                     [ OK ]
 * Starting domain name service... bind9                                                     [ OK ]

Verify caching dns server completely working using dig command. Use dig command to query google.com :

root@ehowstuff:~# dig www.google.com

; <<>> DiG 9.7.3 <<>> www.google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40642
;; flags: qr rd ra; QUERY: 1, ANSWER: 7, AUTHORITY: 13, ADDITIONAL: 0

;; QUESTION SECTION:
;www.google.com.                        IN      A

;; ANSWER SECTION:
www.google.com.         86322   IN      CNAME   www.l.google.com.
www.l.google.com.       223     IN      A       209.85.175.99
www.l.google.com.       223     IN      A       209.85.175.103
www.l.google.com.       223     IN      A       209.85.175.104
www.l.google.com.       223     IN      A       209.85.175.105
www.l.google.com.       223     IN      A       209.85.175.106
www.l.google.com.       223     IN      A       209.85.175.147

;; AUTHORITY SECTION:
.                       14355   IN      NS      m.root-servers.net.
.                       14355   IN      NS      l.root-servers.net.
.                       14355   IN      NS      f.root-servers.net.
.                       14355   IN      NS      d.root-servers.net.
.                       14355   IN      NS      k.root-servers.net.
.                       14355   IN      NS      j.root-servers.net.
.                       14355   IN      NS      g.root-servers.net.
.                       14355   IN      NS      h.root-servers.net.
.                       14355   IN      NS      i.root-servers.net.
.                       14355   IN      NS      a.root-servers.net.
.                       14355   IN      NS      e.root-servers.net.
.                       14355   IN      NS      b.root-servers.net.
.                       14355   IN      NS      c.root-servers.net.

;; Query time: 14 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sun Apr  8 16:21:07 2012
;; MSG SIZE  rcvd: 359

How to Install and Configure Bind Chroot DNS Server on RHEL 6

In this post, i will guide you on how to install and configure Bind Chroot DNS server on Redhat Enterprise Linux 6 (RHEL 6). DNS is the Domain Name System that maintains a database that can help user’s computer to translate domain names to IP addresses. This post will show the installation and configuration for bind-chroot 9.7 version. Assumed that you have configured your RHEL 6 with local yum repository as per documented in the following post.
How to Setup Local Yum Repository from CD-ROM/DVD-ROM image on RHEL 6

1. Install Bind Chroot DNS Server

[root@rhel6 ~]# yum install bind-chroot -y
Loaded plugins: rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package bind-chroot.i686 32:9.7.0-5.P2.el6 set to be updated
--> Processing Dependency: bind = 32:9.7.0-5.P2.el6 for package: 32:bind-chroot-9.7.0-5.P2.el6.i686
--> Running transaction check
---> Package bind.i686 32:9.7.0-5.P2.el6 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package              Arch          Version                     Repository                     Size
====================================================================================================
Installing:
 bind-chroot          i686          32:9.7.0-5.P2.el6           DVD-RHEL6-Repository           65 k
Installing for dependencies:
 bind                 i686          32:9.7.0-5.P2.el6           DVD-RHEL6-Repository          3.5 M

Transaction Summary
====================================================================================================
Install       2 Package(s)
Upgrade       0 Package(s)

Total download size: 3.5 M
Installed size: 6.4 M
Downloading Packages:
----------------------------------------------------------------------------------------------------
Total                                                                30 MB/s | 3.5 MB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : 32:bind-9.7.0-5.P2.el6.i686                                                  1/2
  Installing     : 32:bind-chroot-9.7.0-5.P2.el6.i686                                           2/2

Installed:
  bind-chroot.i686 32:9.7.0-5.P2.el6

Dependency Installed:
  bind.i686 32:9.7.0-5.P2.el6

Complete!

2. Create a file /var/named/chroot/var/named/bloggerbaru.local with the following configuration :

[root@rhel6 ~]# vi /var/named/chroot/var/named/bloggerbaru.local
;
;       Addresses and other host information.
;
@       IN      SOA     bloggerbaru.local. hostmaster.bloggerbaru.local. (
                               2011030801      ; Serial
                               43200      ; Refresh
                               3600       ; Retry
                               3600000    ; Expire
                               2592000 )  ; Minimum

;       Define the nameservers and the mail servers

               IN      NS      ns.bloggerbaru.local.
               IN      A       192.168.1.43
               IN      MX      10 mail.bloggerbaru.local.

mail            IN      A       192.168.1.43
ns              IN      A       192.168.1.43

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. Execute the following command to generate the RNDC key :

[root@rhel6 ~]# rndc-confgen -a -c /etc/rndc.key
wrote key file "/etc/rndc.key"

4. View the content of the RNDC key :

[root@rhel6 ~]# cat /etc/rndc.key
key "rndc-key" {
        algorithm hmac-md5;
        secret "rDy6d+XB4NiAnHWA5N7Jig==";
};

5. Edit the /var/named/chroot/etc/named.conf file for bloggerbaru.local :

[root@rhel6 ~]# 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 bloggerbaru.local

zone "bloggerbaru.local" {
    type master;
    file "bloggerbaru.local";
};

6. Start the DNS service using the following command :

[root@rhel6 ~]# /etc/init.d/named start
Starting named:                                            [  OK  ]

7. To ensure the named daemon will start at boot, execute the following chkconfig :

[root@rhel6 ~]# chkconfig named on

8. Before testing, make sure your pc or server pointing to the DNS Server that has been set up :

[root@rhel6 ~]# cat /etc/resolv.conf
nameserver 192.168.1.43

9. Test your DNS service :

[root@rhel6 ~]# host -t mx bloggerbaru.local
bloggerbaru.local mail is handled by 10 mail.bloggerbaru.local.
[root@rhel6 ~]# host -t ns bloggerbaru.local
bloggerbaru.local name server ns.bloggerbaru.local.

How to Fix “/etc/rndc.key: permission denied” for named Service Error

Symptoms :

I keep getting this error every time I try to start the named daemon service :

    [root@centos62 ~]# service named start
    Starting named:                                            [FAILED]
    

Then i checked at the /var/log/messages, i get the following messages :

    [root@centos62 ~]# tail -f /var/log/messages
    
    Feb  6 21:51:22 centos62 named[1341]: loading configuration from '/etc/named.conf'
    Feb  6 21:51:22 centos62 named[1341]: /etc/named.conf:7: open: /etc/rndc.key: permission denied
    Feb  6 21:51:22 centos62 named[1341]: loading configuration: permission denied
    Feb  6 21:51:22 centos62 named[1341]: exiting (due to fatal error)
    

Solutions :
Change the owner and the files permission of the ‘/etc/named.conf’ :

    [root@centos62 ~]# chown named:named /etc/rndc.key
    [root@centos62 ~]# chmod 644 /etc/rndc.key
    

Start named services :

    [root@centos62 ~]# service named start
    Starting named:                                            [  OK  ]
    

How to Configure Bind Chroot DNS Server on CentOS 6.2

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.
    

How to Install Bind Chroot DNS Server on CentOS 6.2

In this post, i will guide you on how to install Bind Chroot DNS server on CentOS 6.2. DNS is the Domain Name System that maintains a database that can help user’s computer to translate domain names such as www.ehowstuff.com to IP addresses such as 184.173.214.97. DNS on CeentOS is based on the named daemon, which is built on the BIND package developed through the Internet Software Consortium. (More information is available from the BIND home page at www.isc.org/products/BIND.) However, these are RPM packages associated with DNS. But not all required to build Bind Chroot DNS Server.

bind Includes the basic name server software, including /usr/sbin/named.

bind-chroot Includes directories that isolate BIND in a so-called “chroot jail,” which limits access if DNS is compromised.

bind-devel Includes development libraries for BIND.

bind-libbind-devel Contains the libbind BIND resolver library.

bind-libs Adds library files used by the bind and bind-utils RPMs.

bind-sdb Supports alternative databases, such as LDAP. Per the Red Hat Exam Prep guide and course outlines, I see no evidence that such relationships are covered on the Red Hat exams.

bind-utils Contains tools such as dig and host that provide information about a specific Internet host. It should already be installed in any minimum installation of RHEL.

caching-nameserver Includes files associated with a caching nameserver.

system-config-bind A GUI configuration tool useful for adding host and reverse address lookup data. It’s not officially a part of the DNS Name Server package group.

Simply run this command to install Bind Chroot DNS Server :

    [root@centos62 ~]# yum install bind-chroot -y
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: centos.maulvi.net
     * extras: centos.maulvi.net
     * rpmforge: fr2.rpmfind.net
     * updates: centos.maulvi.net
    rpmforge                                                                     | 1.1 kB     00:00
    rpmforge/primary                                                             | 1.5 MB     00:18
    rpmforge                                                                                  4233/4233
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package bind-chroot.i686 32:9.7.3-8.P3.el6_2.2 will be installed
    --> Processing Dependency: bind = 32:9.7.3-8.P3.el6_2.2 for package: 32:bind-chroot-9.7.3-8.P3.el6_2.2.i686
    --> Running transaction check
    ---> Package bind.i686 32:9.7.3-8.P3.el6_2.2 will be installed
    --> Processing Dependency: bind-libs = 32:9.7.3-8.P3.el6_2.2 for package: 32:bind-9.7.3-8.P3.el6_2.2.i686
    --> Processing Dependency: libdns.so.69 for package: 32:bind-9.7.3-8.P3.el6_2.2.i686
    --> Processing Dependency: libbind9.so.60 for package: 32:bind-9.7.3-8.P3.el6_2.2.i686
    --> Processing Dependency: libisccc.so.60 for package: 32:bind-9.7.3-8.P3.el6_2.2.i686
    --> Processing Dependency: libisccfg.so.62 for package: 32:bind-9.7.3-8.P3.el6_2.2.i686
    --> Processing Dependency: liblwres.so.60 for package: 32:bind-9.7.3-8.P3.el6_2.2.i686
    --> Processing Dependency: libisc.so.62 for package: 32:bind-9.7.3-8.P3.el6_2.2.i686
    --> Running transaction check
    ---> Package bind-libs.i686 32:9.7.3-8.P3.el6_2.2 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ====================================================================================================
     Package                Arch            Version                            Repository          Size
    ====================================================================================================
    Installing:
     bind-chroot            i686            32:9.7.3-8.P3.el6_2.2              updates             68 k
    Installing for dependencies:
     bind                   i686            32:9.7.3-8.P3.el6_2.2              updates            3.9 M
     bind-libs              i686            32:9.7.3-8.P3.el6_2.2              updates            850 k
    
    Transaction Summary
    ====================================================================================================
    Install       3 Package(s)
    
    Total download size: 4.8 M
    Installed size: 9.2 M
    Downloading Packages:
    (1/3): bind-9.7.3-8.P3.el6_2.2.i686.rpm                                      | 3.9 MB     00:35
    (2/3): bind-chroot-9.7.3-8.P3.el6_2.2.i686.rpm                               |  68 kB     00:00
    (3/3): bind-libs-9.7.3-8.P3.el6_2.2.i686.rpm                                 | 850 kB     00:08
    ----------------------------------------------------------------------------------------------------
    Total                                                               109 kB/s | 4.8 MB     00:45
    Running rpm_check_debug
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
    Warning: RPMDB altered outside of yum.
      Installing : 32:bind-libs-9.7.3-8.P3.el6_2.2.i686                                             1/3
      Installing : 32:bind-9.7.3-8.P3.el6_2.2.i686                                                  2/3
      Installing : 32:bind-chroot-9.7.3-8.P3.el6_2.2.i686                                           3/3
    
    Installed:
      bind-chroot.i686 32:9.7.3-8.P3.el6_2.2
    
    Dependency Installed:
      bind.i686 32:9.7.3-8.P3.el6_2.2                bind-libs.i686 32:9.7.3-8.P3.el6_2.2
    
    Complete!
    

Next : How to Configure Bind Chroot DNS Server on CentOS 6.2

How to Find The DNS Servers

There is easy way to find the dns servers is using nslookup tool. This command available in windows and linux operating system.There is a few nslookup option that can help us to get more details on the dns server of the website that we browse. See below for example. The result will return the name server of www.quickonlinetips.com and www.problogger.net :

Steps :
1. Go to command prompt in windows or shell in linux.
2. Type nslookup at command prompt and then pressing ENTER
3. Type set type=ns and then pressing ENTER
4. Type the domain that you want to look up and then pressing ENTER

    C:\Documents and Settings\mypc>nslookup
    Default Server:  cns3.tm.net.my
    Address:  202.188.0.133
    
    > set type=ns
    > www.quickonlinetips.com
    Server:  cns3.tm.net.my
    Address:  202.188.0.133
    
    Non-authoritative answer:
    www.quickonlinetips.com canonical name = quickonlinetips.com
    quickonlinetips.com     nameserver = ns2.quickonlinetips.com
    quickonlinetips.com     nameserver = ns1.quickonlinetips.com
    > www.problogger.net
    Server:  cns3.tm.net.my
    Address:  202.188.0.133
    
    Non-authoritative answer:
    www.problogger.net      canonical name = problogger.net
    problogger.net  nameserver = dns1.nettica.com
    problogger.net  nameserver = dns2.nettica.com
    problogger.net  nameserver = dns3.nettica.com
    problogger.net  nameserver = dns4.nettica.com
    problogger.net  nameserver = dns5.nettica.com
    
    dns2.nettica.com        internet address = 64.237.45.34
    dns3.nettica.com        internet address = 64.94.136.13
    dns4.nettica.com        internet address = 69.41.170.223
    dns5.nettica.com        internet address = 212.100.247.15
    dns1.nettica.com        internet address = 64.94.136.11
    >