Welcome to www.freeoraclehelp.com Got questions? Post comments Like the facebook page to get instant updates. Thank you!!!
Total Pageviews

Setup DNS for SCAN in Oracle 11g R2 RAC Implementation

Step by step instructions to install DNS (bind) and configure SCAN in DNS are described in this article. DNS Services (Bind) would be installed in one of the RAC nodes in this example. Of course, you wouldn’t want to run bind in your production RAC nodes. You would have DNS Administrator add three A records for the same name, SCAN.  Once DNS is set up, make sure that all three A records are returned in nslookup. SCAN Setup for Oracle 11g Release2(11gR2) RAC implementation would addresses all the background questions such as what scan is and how it works..etc.

1. Install the RPMS:

#yum install bind_libs bind bind-utils

2. Configure named.conf
[root@rac2 ~]# cat /etc/named.conf 
// Default named.conf generated by install of bind-9.2.4-30.el4_7.2
options {
        directory "/var/named";
        dump-file "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        forwarders { 192.168.1.1; };
};
include "/etc/rndc.key";


zone "freeoraclehelp.com" IN {
type master;
file "freeoraclehelp.com.zone";
allow-update { none; };
};

zone "1.168.192.in-addr.arpa." IN {
type master;
file "1.168.192.in-addr.arpa";
allow-update { none; };
};
[root@rac2 ~]# 

Create entries in Zone files:
[root@rac2 ~]# cat /var/named/1.168.192.in-addr.arpa 
$TTL 86400
$ORIGIN 1.168.192.IN-ADDR.ARPA.
@       IN      SOA     rac2.freeoraclehelp.com.     webmaster.freeoraclehelp.com. (
2
3H
1H
1W
1H )
        IN NS      192.168.1.20
        IN NS      192.168.1.1

10 IN PTR  rac1.freeoraclehelp.com.
20 IN PTR  rac2.freeoraclehelp.com.
11 IN PTR  rac1-vip.freeoraclehelp.com.
22 IN PTR  rac2-vip.freeoraclehelp.com.
23 IN PTR  scan.freeoraclehelp.com.
24 IN PTR  scan.freeoraclehelp.com.
25 IN PTR  scan.freeoraclehelp.com.
[root@rac2 ~]# cat /var/named/freeoraclehelp.com.zone 
$TTL  86400
@ IN SOA      freeoraclehelp.com. freeoraclehelp.com.(
42          ; serial (d. adams)
3H          ; refresh
15M         ; retry
1W          ; expiry
1D )        ; minimum

freeoraclehelp.com. IN NS       192.168.1.20
localhost                       IN A    127.0.0.1
rac1.freeoraclehelp.com.                IN A    192.168.1.10
rac2.freeoraclehelp.com.                IN A    192.168.1.20
rac1-vip.freeoraclehelp.com.  IN A    192.168.1.11
rac2-vip.freeoraclehelp.com.  IN A    192.168.1.22
scan.freeoraclehelp.com.                IN A    192.168.1.23
scan.freeoraclehelp.com.                IN A    192.168.1.24
scan.freeoraclehelp.com.                IN A    192.168.1.25
[root@rac2 ~]# 

3. Start named service:
#/etc/init.d/named restart

Add the init script to start DNS service after the system reboot:
[root@rac2 ~]# chkconfig named on

Finally, test the lookups:
[root@rac2 log]# nslookup scan.freeoraclehelp.com
Server:         192.168.1.20
Address:        192.168.1.20#53

Name:   scan.freeoraclehelp.com
Address: 192.168.1.25
Name:   scan.freeoraclehelp.com
Address: 192.168.1.23
Name:   scan.freeoraclehelp.com
Address: 192.168.1.24

[root@rac2 log]# nslookup 192.168.1.23           
Server:         192.168.1.20
Address:        192.168.1.20#53

23.1.168.192.in-addr.arpa       name = scan.freeoraclehelp.com.

[root@rac2 log]# nslookup 192.168.1.24
Server:         192.168.1.20
Address:        192.168.1.20#53

24.1.168.192.in-addr.arpa       name = scan.freeoraclehelp.com.

[root@rac2 log]# nslookup 192.168.1.25
Server:         192.168.1.20
Address:        192.168.1.20#53

25.1.168.192.in-addr.arpa       name = scan.freeoraclehelp.com.

[root@rac2 log]#

Both RAC nodes would point to this DNS Server on the second RAC Server:
[root@rac1 ~]# cat /etc/resolv.conf   
nameserver 192.168.1.20   # Second RAC Node
nameserver 192.168.1.1    # Primary DNS in the domain
search freeoraclehelp.com # Local Domain
[root@rac1 admin]# nslookup scan
Server:         192.168.1.20
Address:        192.168.1.20#53

Name:   scan.freeoraclehelp.com
Address: 192.168.1.23
Name:   scan.freeoraclehelp.com
Address: 192.168.1.24
Name:   scan.freeoraclehelp.com
Address: 192.168.1.25

[root@rac1 ~]# nslookup scan.freeoraclehelp.com
Server:         192.168.1.20
Address:        192.168.1.20#53

Name:   scan.freeoraclehelp.com
Address: 192.168.1.25
Name:   scan.freeoraclehelp.com
Address: 192.168.1.23
Name:   scan.freeoraclehelp.com
Address: 192.168.1.24

[root@rac1 ~]# 
[root@rac2 ~]# cat /etc/resolv.conf   
nameserver 192.168.1.20   # Second RAC Node
nameserver 192.168.1.1    # Primary DNS in the domain
search freeoraclehelp.com # Local Domain
[root@rac2 ~]# nslookup scan
Server:         192.168.1.20
Address:        192.168.1.20#53

Name:   scan.freeoraclehelp.com
Address: 192.168.1.24
Name:   scan.freeoraclehelp.com
Address: 192.168.1.25
Name:   scan.freeoraclehelp.com
Address: 192.168.1.23

[root@rac2 ~]# nslookup scan.freeoraclehelp.com
Server:         192.168.1.20
Address:        192.168.1.20#53

Name:   scan.freeoraclehelp.com
Address: 192.168.1.23
Name:   scan.freeoraclehelp.com
Address: 192.168.1.24
Name:   scan.freeoraclehelp.com
Address: 192.168.1.25

[root@rac2 ~]# 

/etc/hosts on each node would have all the entries but SCAN:
[root@rac2 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain   localhost
# Public
192.168.1.10   rac1.freeoraclehelp.com     rac1
192.168.1.20   rac2.freeoraclehelp.com     rac2
#Private
192.168.2.10   rac1-priv.freeoraclehelp.com  rac1-priv
192.168.2.20   rac2-priv.freeoraclehelp.com  rac2-priv
#Virtual
192.168.1.11   rac1-vip.freeoraclehelp.com   rac1-vip
192.168.1.22   rac2-vip.freeoraclehelp.com   rac2-vip
[root@rac2 ~]# 

I haven't touched the hosts order in nsswitch.conf, which is
[root@rac1 ~]# grep ^hosts /etc/nsswitch.conf 
hosts:      files dns
[root@rac1 ~]# 

PTR (Reverse DNS) records are optional.. I just wanted to show how to add them. Of course, this is not for production use. DNS administrators in your organization would easily set up these multiple A records.

Related Posts