Install and Configure Authoritative DNS server on CentOS 6.4

Assume the IP of the authoritative DNS server is 192.168.1.2, and the server IPs used in the data files are 192.168.1.3 and 192.168.1.4.

Before reading the rest of this post, make sure you have installed caching only name server as outlined in my past post.

Create forward lookup zone data:
# cd /var/named/chroot/var/named
# vi companycloud.db

Edit according to the following:

$TTL 1D

@ IN SOA ns.companycloud.com. root.ns.companycloud.com. (
                                                                      2013062901 ; serial
                                                                      1D ; refresh
                                                                      1H ; retry
                                                                      1W ; expire
                                                                      3H ) ; minimum
                        NS              ns.companycloud.com.
ns                     A               192.168.1.2
server1            A               192.168.1.3
server2            A               192.168.1.4

 # chown root:named companycloud.db
# chmod 640 companycloud.db

Create reverse lookup zone data:

# vi 1.168.192.db

Edit according to the following:

$TTL 1D
@ IN SOA ns.companycloud.com. root.ns.companycloud.ca. (
                                                                       2013062901 ; serial
                                                                       1D ; refresh
                                                                       1H ; retry
                                                                       1W ; expire
                                                                       3H ) ; minimum
                      NS                        ns.companycloud.com.
2                  PTR                       ns.companycloud.com.
3                  PTR                       server1.companycloud.com.
4                  PTR                       server2.companycloud.com.

# chmod 640 1.168.192.db
# chown root:named 1.168.192.db

Add the following zone definitions to /var/named/chroot/etc/named.conf:

zone “companycloud.com” IN {
   type master;
   file “companycloud.com.db”;
};

zone “1.168.192.in-addr.arpa” IN {
   type master;
   file “1.168.192.db”;
};

Configure the server to act as an Authoritative Server:
change:
recursion yes;

to:
recursion no;

# service named restart

Test on other server:

forward resolve:

# dig +short @192.168.1.2 server1.companycloud.com
192.168.1.3

reverse resolve:

# dig +short @192.168.1.2 -x 192.168.1.3
server1.companycloud.com.

Reference:
http://zenit.senecac.on.ca/wiki/index.php/NAD710_Lab_5A

Advertisements
This entry was posted in Linux Admin Basics. Bookmark the permalink.

One Response to Install and Configure Authoritative DNS server on CentOS 6.4

  1. Pingback: Install and Configure Master and Slave DNS Servers on CentOS 6.4 | Simon (Jingbo)'s IT blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s