Installation

The BIND DNS service is installed from a Yum repository using the following command.

# yum install bind

Depending on your plans for the DNS, you might also find it useful to install the following two packages.

# yum install bind-libs bind-utils

In RHEL5 and Fedora distributions there is a GUI tool called system-config-bind, but this has been removed from RHEL6. In my opinion this is no major loss as I found it more confusing to use than adjusting the configuration files directly.

Turn on the DNS (named) server and make sure it starts automatically on reboot.

# service named start
# chkconfig named on

DNS is configured by altering the contents of the "/etc/named.conf" file and the contents of the "/var/named" directory. Configuration changes have to be followed by a reload or a restart of the DNS service.

# service named restart
# # or
# service named reload
# /etc/init.d/named reload

Firewall

If you are using the Linux firewall, you need to open port 53 specifically. Assuming you are using a firewall setup file, as described here, you can include the following additions to the INPUT chain.

Configure a caching-only name server

By default the contents of the "/etc/named.conf" file configure a caching-only name server that is restricted to the local machine. This is indicated by the following entries in the "options" section of the configuration file.

allow-query { localhost; };
recursion yes;

To extend this amend the "allow-query" entry, adding a ";" separated list of IP addresses or wildcards to signify which machines can query the DNS server. Alternatively, use the "any" value.

Configure a caching-only name server to forward DNS queries

Adding the "forwarders" parameter to the "options" section of the "/etc/named.conf" file allows the DNS to forward any unresolved names to alternative DNS servers. This is commonly used when a company DNS resolves all internal company names, but forwards external names to the DNS provided by an internet service provider.