A DNS server, or name server, is used to resolve an IP address to a hostname or vice versa.
You can set up four different types of DNS servers:
A master DNS server for your domain(s), which stores authoritative records for your domain.
A slave DNS server, which relies on a master DNS server for data.
A caching-only DNS server, which stores recent requests like a proxy server. It otherwise refers to other DNS servers.
A forwarding-only DNS server, which refers all, requests to other DNS servers.
CONFIGURE DNS SERVER
In this example we will configure a dns server and will test from client side.
For this example we are using three systems one linux server one linux clients and one window clients.
Step 1 - bind and caching-nameserver rpm is required to configure dns. Check them for install if not found install them
Step 2 - set hostname to server.example.com and ip address to 192.168.0.254
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 our example we are creating a new named.conf file
Or do editing exactly as shown here in p_w_picpath
save this file with :wq and exit
Configure 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.
By default this file will look like this
Change this file exactly as shown in p_w_picpath below
Now open reverse lookup zone file 0.168.192.in-addr.arpa
By default it will look like this
Change this file exactly as shown in p_w_picpath below
Now changed the ownership of these zone files to named group