A DNS Server is used to resolve an IP address to hostname or hostname to IP address. There are 4 different types of DNS Server :-

  1. A Master DNS
  2. A Slave DNS
  3. A Caching only DNS
  4. A Forwarding only DNS

Configuring A DNS Server

  1. Bind and Caching name server is required to configure a DNS.
l1

2.  Set hostname to server.example.com and IP address to 192.168.0.254

l2

Main configuration file for dns server is named.conf. By default this file is not created in /var/named/chroot/etc/ directory. Instead of named.conf a sample file /var/named/chroot/etc/named.caching-nameserver.conf is created. This file is use to make a caching only name server. You can also do editing in this file after changing its name to named.conf to configure master dns server or you can manually create a new named.conf file.

In this example we are creating a new named.conf file

l3

Save this file with :wq and exit

Configuring zone file

We have defined two zone files example.com.zone for forward zone and 0.168.192.in-addr.arpa for reverse zone. These files will be store in /var/named/chroot/var/named/ location. We will use two sample files for creating these files.

l4

A default file will look like this :

l5

Make the changes as shown in image below :

l6

Now open reverse lookup zone file 0.168.192.in-addr.arpa

l7

By default it will look like this :

l8

Make the following changes as shown in figure :

l9

Now changed the ownership of these zone files to named group :

l10