How to Install DNS (BIND) on CentOS 6.2

Step 1. Installation of required packages.

We use yum to install BIND packages.

# yum -y install bind bind-libs bind-utils

Step 2.  Set BIND service start on system boot (Optional)

# chkconfig –-level 35 named on

Step 3. Start named service for generating some default configuration files.

# service named start

Step 4. Edit main configuration file and add zone entry of http://www.monirblog.com.

# vi /etc/named.conf
Check allow query {any;}


add the following lines:

zone "." IN {
        type hint;
        file "named.ca";
};
zone "monirblog.com" {
        type master;
        file "monirblog.com.fwd";
};
zone "0.168.192.in-addr.arpa" {
        type master;
        file "monirblog.com.rev";
};
include "/etc/named.rfc1912.zones";

Step 5. Create Zone files which we mentioned in named.conf file.

# cd /var/named
(If permission denied then type the following)
# chmod 775 /var/named/

 # vi monirblog.com.fwd $ORIGIN monirblog.com. $TTL 3D @       SOA     dns.monirblog.com.     root.monirblog.com. (12 4h 1h 1w 1h) @       IN      NS      dns.monirblog.com. dns.monirblog.com.     IN      A       192.168.0.211 www                                     IN      A       192.168.0.211 # vi monirblog.com.rev $ORIGIN 0.168.192.in-addr.arpa. $TTL 3D @       SOA     dns.monirblog.com.     root.monirblog.com. (12 4h 1h 1w 1h) @       IN      NS      dns.monirblog.com. 211     IN      PTR     dns.monirblog.com.

Step 6.  Restart BIND Service

# service named restart

Step 7.  Test your DNS server

Note : Before testing , make sure your /etc/resolve.conf file contain DNS server ip that has been set up.

# cat /etc/resolve.conf

search monirblog.com

nameserver 192.168.0.211
# nslookup www.monirblog.com

Server:         192.168.0.211

Address:        192.168.0.211#53

Name:   www.monirblog.com

Address: 192.168.0.211
# nslookup 192.168.0.211

Server:         192.168.0.211

Address:        192.168.0.211#53

211.0.168.192.in-addr.arpa      name = dns.monirblog.com.


Reff:
1. http://www.broexperts.com/2012/03/linux-dns-bind-configuration-on-centos-6-2/
2. http://studyhat.blogspot.com/2012/02/dns-configuration-on-centos-redhat-62.html
3. http://www.revsys.com/writings/quicktips/bind-permission.html

Advertisements
By simplemsexchange Posted in Linux

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