Total Pageviews

Sunday, November 13, 2011

Setting Up BIND DNS on RHEL6 for RHEV3

RHEL6  BIND DNS Set up  for RHEV 3

You need a Fully Functional DNS  before setting up RHEV in  your Environment. So we are going to see how to use  BIND which ships with Red Hat by default to set up one for us.


Berkeley Internet Name Domain (BIND) daemon, is the most widely used DNS software on the Internet On Unix-like operating systems. It provides a robust and stable platform on top of which organizations can build distributed computing systems with the knowledge that those systems are fully compliant with published DNS standards.

Explaining BIND in detail is totally out of scope of this Document  so I am taking  you directly to  quickly  set up  and  run your own DNS Server on your environment.

Install BIND 

# yum install bind bind-utils bind-libs

Once you installed you need to tweak the  /etc/named.conf relevant to your environment.

Working Sample  /etc/named.conf , Just you need to tune the one which is in bold in the below sample file.


#vi /etc/named.conf 

//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {
        listen-on port 53 { 127.0.0.1; 192.168.70.25; }; ##Listen on this IP
        listen-on-v6 port 53 { none; };  ## disable ipv6
        directory       "/var/named";  ### Zone File
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        allow-query     { localhost; 192.168.70.0/24; }; ## Allow host in this subnet query DNS service
        recursion yes;
/*      forwarders { 192.168.127.10; 192.168.127.11; };

/*      dnssec-enable no;
/*      dnssec-validation no;
/*      dnssec-lookaside auto;

        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";
};
 
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
        type hint;
        file "named.ca";
};
##Need to Add this below Forward & Reverse Entries
#Forward Zone for rhev3.in  domain 
zone "rhev3.in" IN {
type master;
file "rhev3.in.zone";
};

#Reverse Zone for rhev3.in domain
zone "70.168.192.in-addr.arpa" IN {
type master;
file "192.168.70.zone";
};


include "/etc/named.rfc1912.zones";
#<End of sample>

Once you Configured Save the file and Close it.

Creating Forward Zone 
 
   In a DNS Forward ZONE  used for the mapping of humanly-practical, name-based domains to mostly numerically identified Internet resources. Such domain name resolution is also referred to as forward resolution and the DNS zones associated with such process are often referred to as forward zones..
  See  below Sample working file for more details and change it as per your environment.
  
Note: Carefully Note the ldap & kerberos related entries, it is mandatory if you are going to join your rhev manager instance with IPA Directory Service Failling to add this will results in unable  to add  rhev manager with IPA Directory Service and for more detail on adding RHEV to IPA Refer  RHEV3 Cook Book.

#vi /var/named/rhev3.in.zone

$ORIGIN rhev3.in.
$TTL 1D
@                                       IN SOA  dns1.rhev3.in. hostmaster.rhev3.in. (
                                        200111018   ; serial
                                        21600       ; refresh after 6 hours
                                        3600        ; retry after 1 hour
                                        604800      ; expire after 1 week
                                        86400       ; minimum TTL of 1 day
)



@               IN      NS      dns1.rhev3.in.
dns1            IN      A       192.168.70.25;
rhevmanager     IN      A       192.168.70.26;
ntp             IN      A       192.168.70.7;
hyp1-ml350g6    IN      A       192.168.70.31;
hyp2-dl580g5    IN      A       192.168.70.32;
nfsiso          IN      A       192.168.70.29;
iscsi           IN      A       192.168.70.28;
_ldap._tcp      IN      SRV     0 100 389       rhevmanager.rhev3.in.
_kerberos._tcp  IN      SRV     0 0 88  rhevmanager.rhev3.in.
#<END OF SAMPLE>

Save the File and Now Create a Reverse Lookup Zone File.


Creating Reverse  Zone 

This is used for the reverse process, namely the process of finding the DNS name associated with an IP address.

To configure Reverse Zone  create a reverse file. See  below Sample working file for more details and change it as per your environment.

#vi /var/named/192.168.70.zone

$ORIGIN 70.168.192.in-addr.arpa.
$TTL 1D
@        IN SOA  dns1.rhev3.in.         hostmaster.rhev3.in. (
                                        200111013   ; serial
                                        21600       ; refresh after 6 hours
                                        3600        ; retry after 1 hour
                                        604800      ; expire after 1 week
                                        86400       ; minimum TTL of 1 day
)

@               IN      NS      dns1.rhev3.in.
26              IN      PTR     rhevmanager.rhev3.in.
7               IN      PTR     ntp.rhev3.in.
31              IN      PTR     hyp1-ml350g6.rhev3.in.
32              IN      PTR     hyp2-dl580g5.rhev3.in.
28              IN      PTR     iscsi.rhev3.in.
29              IN      PTR     nfsiso.rhev3.in.
#<End of sample>

Next Disable IPV6 by adding OPTIONS="-4"  at the last on the file /etc/sysconfig/named

Start the Service and check for errors and in /var/log/messages.

#/etc/init.d/named  restart ; tailf /var/log/messages

If started with out any errors then check nslookup to verify all your forward and reverse lookups are configured and working fine.

Finally If everything works as you expected Mark the service to "ON"  in system run level so that named service will start upon system reboot automatically.

#chkconfig  named on


You are Done, Go back to RHEV3 Cook Book for More Cooking
http://rcritical.blogspot.com/2011/09/rhev-3-cookbook.html

Reference: http://www.isc.org/software/bind

1 comment:

virtualization said...

Currently I work for Dell and thought your article on virtualization is quite impressive. I think virtualization, in computing, is the creation of a virtual (rather than actual) version of something, such as a hardware platform, operating system, a storage device or network resources.