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
[margin margin_top=”20px”]
[titles text=”Q29uZmlndXJpbmclMjBBJTIwRE5TJTIwU2VydmVy” font_container=”color:%23dd9933″ type=”h2″ text_align=”center”][margin margin_top=”20px”]
  1. Bind and Caching name server is required to configure a DNS.
[margin margin_top=”20px”]
[margin margin_top=”20px”]

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

[margin margin_top=”20px”]
[margin margin_top=”10px”]

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

Save this file with :wq and exit

[margin margin_top=”20px”]

Configuring zone file

[margin margin_top=”20px”]

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.

[margin margin_top=”10px”]
[margin margin_top=”10px”]

A default file will look like this :

[margin margin_top=”10px”]

Make the changes as shown in image below :

[margin margin_top=”10px”]
[margin margin_top=”10px”]

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

[margin margin_top=”10px”]

By default it will look like this :

[margin margin_top=”10px”]

Make the following changes as shown in figure :

[margin margin_top=”10px”]
[margin margin_top=”10px”]

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

[margin margin_top=”10px”]