How to Configure BIND On Linux (RHEL7/CentOS7)

How to Configure BIND On Linux (RHEL7/CentOS7)

How to Configure BIND On Linux (RHEL7/CentOS7)

What is DNS ?

How to Configure BIND On Linux (RHEL7/CentOS7)

In ths Tutorial we are going to learn How to Configure BIND On Linux CentOS/RHEL7 so lets first start with DNS.

DNS (Domain Name System) is a hierarchical structure that is responsible for resolving hostnames into their numerical IP addresses for computer systems and vice versa.

  • Domain Name System has been used on the internet and in the private networks as well.

Type of DNS Servers

Primary or Master DNS Server

A Primary or Master DNS server has authority of its domain and it is maintainer of domain’s original zone data. Domain zone files are maintained on the primary DNS servers and they can propagate domain’s record to secondary servers.

Secondary or Slave DNS Sever

A Secondary or Slave DNS server also has the authority of its domain and they stores domain’s zone data files as well but they just copied these files from primary DNS server. Whenever primary server made the update to domain zone files, the secondary server simply copy the updated file from primary server automatically. Secondary or Slave DNS servers are used to offloading the primary.

Caching-Only DNS Server

A Caching DNS Server doesn’t have any authority for any domain. They just answer client queries after getting reply from Pimary or Secondary DNS servers.

Caching servers are mostly used for redundancy, load sharing and provide faster response to the client queries.

  • Caching-Only DNS Server delivers data from the memory rather than from the disk.

What is BIND in Linux ?

BIND is short form of (Berkeley Iinternet Name Domain) which is implementation of DNS on Linux Operating System. It is one of the most popular and open source DNS application used by ISP (Internet Service Providers) and also by the private networks.

  • RHEL7/CentOS7 offers BIND as their default DNS software.

In this giude we will configure Caching-Only DNS Server and later in next coming articles we will install Primary and Slave DNS Servers. So for now let’s install Caching-Only DNS Server on RHEL7/CentOs 7

If you are using CentOS 6.x, you should follow the below link.

Required steps to install Caching-Only DNS Server

  1. Install BIND Package
  2. Modify BIND configuration file (/etc/named.conf)
  3. Enable BIND service at system startup
  4. Start the BIND service
  5. Allow DNS service port 53 in firewall
  6. Testing from client side

Step 1: Install BIND packages

yum install bind bind-utils -y

Step 2: Modify BIND Configuration File (/etc/named.conf)

  • By default it works as a localhost DNS resolver only

Allow DNS to accept and answer client DNS queries from your local subnet edit named.conf file using Vi Text Editor and modify the following parameters according to your network settings.

options {
listen-on port 53 { any; };
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”;
allow-query { any; };
recursion yes;
dnssec-enable no;
dnssec-validation no;
}

To verify configuration done in correct manners use the following command

named-checkconf

Step 3: Enable BIND Service at System Startup

systemctl enable named.service

Step 4: Start BIND Service

systemctl start named.service

To check status

systemctl status named.status

Step 5: Allow DNS Port 53 in Linux Firewall

firewall-cmd –permanent –add-service=dns
firewall-cmd –reload

Step 6: Testing From Client Side

For testing purpose we have one windows 7 client machine in our network. Before you start testing, make sure client ip settings is pointing our local caching only dns server as primary dns.

  • In my test lab network DNS serve IP is: 192.168.2.100/24.

nslookoup www.linuxmasterswiki.com

See result below:

Was this Tutorial helpful? Help others share on Facebook, Twitter, and Google Plus!

 
Enjoyed this video?
How to Configure BIND On Linux (RHEL7/CentOS7)
"No Thanks. Please Close This Box!"