How to Install and Configure Bind Chroot DNS Server on Fedora 16

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 and Fedora 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. In this post, i will guide you on how to install and configure Bind Chroot DNS server on linux Fedora 16 server.

1. Simply run this command to install Bind Chroot DNS Server :

[root@fedora16 ~]# yum install bind-chroot -y

Examples :

[root@fedora16 ~]# yum install bind-chroot -y
Fedora16-Repository                                                          | 3.7 kB     00:00 ...
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package bind-chroot.i686 32:9.8.2-1.fc16 will be installed
--> Processing Dependency: bind = 32:9.8.2-1.fc16 for package: 32:bind-chroot-9.8.2-1.fc16.i686
--> Running transaction check
---> Package bind.i686 32:9.8.2-1.fc16 will be installed
--> Processing Dependency: bind-libs = 32:9.8.2-1.fc16 for package: 32:bind-9.8.2-1.fc16.i686
--> Processing Dependency: liblwres.so.80 for package: 32:bind-9.8.2-1.fc16.i686
--> Processing Dependency: libisccfg.so.82 for package: 32:bind-9.8.2-1.fc16.i686
--> Processing Dependency: libisccc.so.80 for package: 32:bind-9.8.2-1.fc16.i686
--> Processing Dependency: libisc.so.83 for package: 32:bind-9.8.2-1.fc16.i686
--> Processing Dependency: libdns.so.81 for package: 32:bind-9.8.2-1.fc16.i686
--> Processing Dependency: libbind9.so.80 for package: 32:bind-9.8.2-1.fc16.i686
--> Running transaction check
---> Package bind-libs.i686 32:9.8.2-1.fc16 will be installed
--> Processing Dependency: bind-license = 32:9.8.2-1.fc16 for package: 32:bind-libs-9.8.2-1.fc16.i686
--> Running transaction check
---> Package bind-license.noarch 32:9.8.1-2.fc16 will be updated
--> Processing Dependency: bind-license = 32:9.8.1-2.fc16 for package: 32:bind-libs-lite-9.8.1-2.fc16.i686
---> Package bind-license.noarch 32:9.8.2-1.fc16 will be an update
--> Running transaction check
---> Package bind-libs-lite.i686 32:9.8.1-2.fc16 will be updated
---> Package bind-libs-lite.i686 32:9.8.2-1.fc16 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                   Arch              Version                       Repository          Size
====================================================================================================
Installing:
 bind-chroot               i686              32:9.8.2-1.fc16               updates             71 k
Installing for dependencies:
 bind                      i686              32:9.8.2-1.fc16               updates            2.0 M
 bind-libs                 i686              32:9.8.2-1.fc16               updates            860 k
Updating for dependencies:
 bind-libs-lite            i686              32:9.8.2-1.fc16               updates            621 k
 bind-license              noarch            32:9.8.2-1.fc16               updates             72 k

Transaction Summary
====================================================================================================
Install       3 Packages
Upgrade       2 Packages

Total download size: 3.6 M
Downloading Packages:
(1/5): bind-9.8.2-1.fc16.i686.rpm                                            | 2.0 MB     00:18
(2/5): bind-chroot-9.8.2-1.fc16.i686.rpm                                     |  71 kB     00:00
(3/5): bind-libs-9.8.2-1.fc16.i686.rpm                                       | 860 kB     00:07
(4/5): bind-libs-lite-9.8.2-1.fc16.i686.rpm                                  | 621 kB     00:04
(5/5): bind-license-9.8.2-1.fc16.noarch.rpm                                  |  72 kB     00:00
----------------------------------------------------------------------------------------------------
Total                                                               113 kB/s | 3.6 MB     00:32
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating   : 32:bind-license-9.8.2-1.fc16.noarch                                              1/7
  Installing : 32:bind-libs-9.8.2-1.fc16.i686                                                   2/7
  Installing : 32:bind-9.8.2-1.fc16.i686                                                        3/7
  Installing : 32:bind-chroot-9.8.2-1.fc16.i686                                                 4/7
  Updating   : 32:bind-libs-lite-9.8.2-1.fc16.i686                                              5/7
  Cleanup    : 32:bind-libs-lite-9.8.1-2.fc16.i686                                              6/7
  Cleanup    : 32:bind-license-9.8.1-2.fc16.noarch                                              7/7

Installed:
  bind-chroot.i686 32:9.8.2-1.fc16

Dependency Installed:
  bind.i686 32:9.8.2-1.fc16                      bind-libs.i686 32:9.8.2-1.fc16

Dependency Updated:
  bind-libs-lite.i686 32:9.8.2-1.fc16              bind-license.noarch 32:9.8.2-1.fc16

Complete!

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

[root@fedora16 ~]# vi /var/named/chroot/var/named/fedora16.local

Examples :

;
;       Addresses and other host information.
;
@       IN      SOA     fedora16.local. hostmaster.fedora16.local. (
                               2012051901      ; Serial
                               43200      ; Refresh
                               3600       ; Retry
                               3600000    ; Expire
                               2592000 )  ; Minimum

;       Define the nameservers and the mail servers

               IN      NS      ns.fedora16.local.
               IN      A       192.168.1.47
               IN      MX      10 mail.fedora16.local.

mail            IN      A       192.168.1.51
ns              IN      A       192.168.1.47

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@fedora16 ~]# rndc-confgen -a -c /etc/rndc.key
wrote key file "/etc/rndc.key"

View the content of the RNDC key :

[root@fedora16 ~]# cat /etc/rndc.key
key "rndc-key" {
        algorithm hmac-md5;
        secret "B2rQEFnrdcAzAt2BiUmBug==";
};

4. Edit the /var/named/chroot/etc/named.conf file for fedora16.local

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

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

5. Start the DNS service using the following command :

[root@fedora16 ~]# /etc/init.d/named start
Starting named (via systemctl):                            [  OK  ]

6. Make named daemon auto start during boot :

[root@fedora16 ~]# chkconfig named on

7. Before testing, make sure your pc or server using the Bind Chroot DNS Server that has been set up :

See also  4 Top Command Howto on Linux RHEL 6/CentOS 6

Test DNS using host command :

[root@fedora16 ~]# host -t mx fedora16.local
fedora16.local mail is handled by 10 mail.fedora16.local.

Test DNS using nslookup command :

[root@fedora16 ~]# nslookup
> ns.fedora16.local
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   ns.fedora16.local
Address: 192.168.1.47
> mail.fedora16.local
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   mail.fedora16.local
Address: 192.168.1.51

How to Reset the Directory Manager Password on RHEL 7 / CentOS 7
How to Reset the Directory Manager Password on RHEL 7 / CentOS 7

It is best practice to remember passwords, but because too many passwords, sometimes we forget. We are not encouraged to write the password on any paper or share the password...

How to Find Big Files Size on Linux RHEL/CentOS
How to Find Big Files Size on Linux RHEL/CentOS

As the linux administrator, sometimes we have to identify which files are most take much space in the linux server resulting in low free space. Low disk space can also...

Why Linux users should worry about malware and what they can do about it
Why Linux users should worry about malware and what they can do about it

Don’t drop your guard just because you’re running Linux. Preventing the spread of malware and/or dealing with the consequences of infection are a fact of life when using computers. If...

How to Reset Forgotten Root Password on Linux RHEL 7 / CentOS 7
How to Reset Forgotten Root Password on Linux RHEL 7 / CentOS 7

This short howto will explain the steps to reset a lost root password or to reset a forgotten root password on Linux RHEL 7 or CentOS 7. Basically, we will...

How to Update CentOS or Upgrade CentOS to the Latest Version
How to Update CentOS or Upgrade CentOS to the Latest Version

Recently, the latest version of CentOS 7.3 was released. All users of CentOS 7.0, 7.1 and 7.2 can upgrade their system to the most recent. This quick guide will explain...

How to Change your WordPress Username, Nickname and Display Name in MySQL
How to Change your WordPress Username, Nickname and Display Name in MySQL

After you create an account log in WordPress, you may want to change your WordPress username, as appropriate or due to security reason. However, you can not do this from...

How to Enable SSH Root Login on Ubuntu 16.04
How to Enable SSH Root Login on Ubuntu 16.04

As what we wrote in the previous article on how to allow SSH root on Ubuntu 14.04, after installing a fresh new copy of Ubuntu 16.04 LTS, we find that...

How to Change UUID of Linux Partition on CentOS 7
How to Change UUID of Linux Partition on CentOS 7

UUID (Universally Unique IDentifier) should be unique and it is used to identify storage devices on a linux system. If you cloned a virtual machine from vCenter, the metadata containing...

Leave a Reply

Your email address will not be published. Required fields are marked *