Configure DNS Server in REDHAT Linux 5

In Oracle 11gR2 we have a new feature SCAN (Single Client Access Name) , where we give three IP addresses with single name in DNS server.

I am not an expert in Linux , this is a very basic configuration I have done in my personal laptop for installing and configuring Oracle RAC.

My RAC Configuration :-

Nodes : 2

Public IPs :-

node1.oracle.com : 192.9.1.100
node2.oracle.com : 192.9.1.101

Private IPs :-

node1-priv.oracle.com : 10.0.0.1
node2-priv.oracle.com : 10.0.0.2

Virtual Ips :-

node1-vip.oracle.com : 192.9.1.200
node2-vip.oracle.com : 192.9.1.201  
 
Scan IPs :-

oguri-scan.oracle.com   192.9.1.131
                        192.9.1.132
                        192.9.1.133

DNS Server : 192.9.1.101 ( In the second node I have configured the DNS Server)

Domain : oracle.com

Steps to Configure DNS Server :-

1) Install the required packages for the DNS server using below commands.

rpm -ivh bind-9.3.6-4.P1.el5.x86_64.rpm
rpm -ivh bind-chroot-9.3.6-4.P1.el5.x86_64.rpm


2) Edit/Create the file “/var/named/chroot/etc/named.conf” and add the below content according to your environment.

[root@node2 etc]# cat named.conf
options{
        directory “/var/named”;
};

zone “oracle.com” {
        type master;
        file “oracle.com.zone”;
        allow-transfer {192.9.1.1;};
};
zone “1.9.192.in-addr.arpa” {
        type master;
        file “1.9.192.in-addr.arpa.zone”;
};
zone “.”
{
type hint;
file “/dev/null”;
};

3) Create a forward lookup zone file “oracle.com.zone” in location “/var/named/chroot/var/named” with below content.

[root@node2 named]# cat oracle.com.zone
$TTL    86400
@                SOA           oracle.com.       root (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum

@               NS              node2.oracle.com.
#@              NS              node1.oracle.com.
node1           A               192.9.1.100
node2           A               192.9.1.101
openfiler       A               192.9.1.150
node1-vip       A               192.9.1.200
node2-vip       A               192.9.1.201
node1-priv      A               10.0.0.1
node2-priv      A               10.0.0.2
oguri-scan      A               192.9.1.131
oguri-scan      A               192.9.1.132
oguri-scan      A               192.9.1.133

4) Create a reverse lookup zone file “1.9.192.in-addr.arpa.zone” in location “/var/named/chroot/var/named” with below content.

[root@node2 named]# cat 1.9.192.in-addr.arpa.zone
$TTL    86400
@       IN      SOA     oracle.com. root.node2.oracle.com.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
        IN      NS      node2.oracle.com.
100     IN      PTR     node1.
101     IN      PTR     node2.
1       IN      PTR     node1-priv.
2       IN      PTR     node2-priv.
131     IN      PTR     oguri-scan.
132     IN      PTR     oguri-scan.
133     IN      PTR     oguri-scan.
200     IN      PTR     node1-vip.
201     IN      PTR     node2-vip.


5) Start the DNS service.

[root@node2 named]# service named start
Starting named: [  OK  ]

6) chkconfig named on ==> Service will start automatically after rebooting the server.

7) Test the DNS server.

[root@node2 named]# nslookup oguri-scan
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   oguri-scan.oracle.com
Address: 192.9.1.132

Name:   oguri-scan.oracle.com
Address: 192.9.1.133
Name:   oguri-scan.oracle.com
Address: 192.9.1.131

[root@node2 named]#
[root@node2 named]# nslookup oguri-scan
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   oguri-scan.oracle.com
Address: 192.9.1.131

Name:   oguri-scan.oracle.com
Address: 192.9.1.132
Name:   oguri-scan.oracle.com
Address: 192.9.1.133
 

We can see that we are able to resolve the scan name in "round-robin" fashion.

***********************************

Now go to the application server , make an entry in the /etc/resolv.conf file with the IP Address of DNS server like below.

[root@node1 etc]# cat resolv.conf
nameserver 192.9.1.101





Problems I faced :-

When I try to test the scan name in another node , I got the below error.

[root@node1 named]# nslookup oguri-scan.oracle.com
;; connection timed out; no servers could be reached

This is because , the firewall in the DNS server is not allowing the connection. stop the firewall in the DNS Server using the below command.

service iptables stop



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 )

Connecting to %s