In this tutorial we will cover the steps needed to install Bind on your CentOS 6.4, Debian or Ubuntu platform.

Requirements

  • CentOS 6.4, Debian or Ubuntu installed on your computer/server
  • SSH access (Command line access to the server)
  • root privileges
  • Basic skills for working on a Linux environment

BIND is one of the most popular DNS software for Unix-based systems. It is used for domain name resolution – in other words translating the domain name to an IP address and vise versa. At least two name servers are required – primary and secondary – so in case of a problem with one of them the other will still be able to perform the translation and return result.

Install BIND

In order to install the BIND service we will use the default package manager included inside the corresponding Linux distribution:

CentOS 6.4

Debian/Ubuntu

You will be prompted to confirm the installation. During the process additional packages required by the BIND service can be installed as well. The installation should be performed on both (all) servers.

Configure BIND

For the configuration we will use the following information:

where you can use the IP addresses of your servers and replace yourdomain.com with your fully qualified domain name.

Configure BIND in CentOS 6.4

We will start with the configuration of the primary DNS server:

After that we can create both the forward and reverse DNS zone files:

and:

In order to check the syntax of the files we can use the following commands:

After that we can start the service:

We will use similar configuration for Server 2 (secondary):

After that we can start the service on the secondary server as well:

The forward and the reverse DNS zone files on the secondary server will be automatically replicated from the primary DNS server.

Configure BIND in Debian/Ubuntu

We can start by editing the BIND options configuration file of the primary server :

We can save the file, exit and continue with the next configuration file:

After that we need to create the forward and reverse DNS zone files:

We will continue with the configuration of the secondary server:

We can use the following commands to check whether the syntax of the files is correct:

In order for the changes to take effect we will restart the BIND service:

The forward and the reverse DNS zone files on the secondary server will be automatically replicated from the primary DNS server.

Test the functionality of the BIND service

We can use the nslookup command to query the DNS server:

Start Up BIND automatically on server boot

In order for the service to start automatically upon server boot up you can execute the following command:

CentOS 6.4

Debian/Ubuntu