How to Install DNS (BIND) on CentOS 6.2

DNS is very important component of network infrastructure, without DNS we can’t browse a website with host-name. DNS (BIND) translates human readable hostnames such as into machine readable ip addresses such as


Don’t Miss: How to Caching-Only DNS on CentOS7 / RHEL7

This translation also occurs when you are connecting to other system on your local network through their host-names instead of their IP addresses. Most of Internet DNS Server (root DNS Servers) run BIND as their DNS software.


In this article we are going to cover BIND installation.

Server Details

Server Name =
Server IP =

Step 1

Installation of required packages.
We will use yum to install BIND packages.

# yum -y install bind bind-libs bind-utils

Step 2

Set BIND service start on system boot

# chkconfig --level 35 named on

Step 3

Start named service for generating some default configuration files.

# service named start

Step 4

Edit main configuration file and add zone entry of “”.

# vi /etc/named.conf

Replace named.conf content with below contents ( dont forget to replace your domain name instead of

// named.conf
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
// See /usr/share/doc/bind*/sample/ for example named configuration files.
options {
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        recursion yes;
        dnssec-enable yes;
        dnssec-validation yes;
        dnssec-lookaside auto;
        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";
logging {
        channel default_debug {
                file "data/";
                severity dynamic;
zone "." IN {
        type hint;
        file "";
zone "" {
        type master;
        file "";
zone "" {
        type master;
        file "";
include "/etc/named.rfc1912.zones";

Step 5

Create Zone files which we mentioned in named.conf file.

# cd /var/named
# vi
@       SOA (12 4h 1h 1w 1h)
@       IN      NS     IN      A
www                                     IN      A
# vi
@       SOA (12 4h 1h 1w 1h)
@       IN      NS
211     IN      PTR

Step 6

Restart BIND Service

# service named restart

Step 7

Test your DNS server
Note : Before testing , make sure your /etc/resolve.conf file contain DNS server ip that has been set up.

# cat /etc/resolve.conf


# nslookup
# nslookup
Address:      name =

Bind Server Installation + configurations
Bind Caching-Only on CentOs 6.4
Watch Video :

Similar Posts