Skip to content

Setup DNS for RAC 12c implementation in virtual Box

If you are plan to implement rac setup in virtul box for your lab practise, you need to setup a dns configuration necessary steps to use single client access name (SCAN) introduced in 11gR2 RAC.

The DNS setup may be a separate server, or you can make it on any one of the nodes you’re preparing for rac implementation.

Here I have chosed to setup on rac first node, so you need to do some setup here

RAC First node :

Step 1:

Below rpm package need to installed on rac first node.

[root@racnode1 ~]# rpm -qa|grep bind
bind-libs-9.3.6-20.P1.el5_8.6
bind-9.3.6-20.P1.el5_8.6
system-config-bind-4.0.3-6.el5
bind-utils-9.3.6-20.P1.el5_8.6

 

Step 2:

check named.conf file available in /etc/ and also /var/named, If it’s not available, Please copy those files from

[root@racnode1 etc]# pwd
/usr/share/doc/bind-9.3.6/sample/etc
[root@racnode1 etc]# ls
named.conf named.conf.bkp named.rfc1912.zones named.root.hints rndc.conf
[root@racnode1 etc]# cp * /etc

 

[root@racnode1 etc]# cd ..
[root@racnode1 sample]# cd var
[root@racnode1 var]# ls
named var
[root@racnode1 var]# cp -r named /var

 

Step 3: edit the file like below

[root@racnode1 var]# cat /etc/named.conf
//
// Sample named.conf BIND DNS server ‘named’ configuration file
// for the Red Hat BIND distribution.
//
// See the BIND Administrator’s Reference Manual (ARM) for details, in:
// file:///usr/share/doc/bind-*/arm/Bv9ARM.html
// Also see the BIND Configuration GUI : /usr/bin/system-config-bind and
// its manual.
//
options
{
// Those options should be used carefully because they disable port
// randomization
// query-source port 53;
// query-source-v6 port 53;

// Put files that named is allowed to write in the data/ directory:
directory “/var/named”; // the default
dump-file “data/cache_dump.db”;
statistics-file “data/named_stats.txt”;
// memstatistics-file “data/named_mem_stats.txt”;
forwarders {192.168.1.1;};

};
key ddns_key
{
algorithm hmac-md5;
secret “gTsUbdMeXIAIOfeSUO6abZ2LkFqwOu3gKHih1Y4jqNEJeQXnnBM8S1xx”;
};

zone “racnode.com” IN {
type master;
file “racnode.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; };
};

Step 4:  Create entries in zone file

[root@racnode1 named]# cat 1.168.192.in-addr.arpa

$TTL 86400
$ORIGIN 1.168.192.in-addr.arpa.

@ IN SOA racnode1.racnode.com. root.racnode.com.( 2
3H
1H
1W
1H )
IN NS 192.168.1.101
IN NS 192.168.1.1
101 IN PTR racnode1.racnode.com.
102 IN PTR racnode2.racnode.com.
111 IN PTR racnode1-vip.racnode.com.
112 IN PTR racnode2-vip.racnode.com.
201 IN PTR rac-scan.racnode.com.
202 IN PTR rac-scan.racnode.com.
203 IN PTR rac-scan.racnode.com.

 

[root@racnode1 named]# cat racnode.com.zone
$TTL 86400
@ IN SOA racnode.com. racnode.com.(
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
racnode.com. IN NS 192.168.1.101
localhost IN A 127.0.0.1
racnode1.racnode.com. IN A 192.168.1.101
racnode2.racnode.com. IN A 192.168.1.102
racnode1-vip.racnode.com. IN A 192.168.1.111
racnode2-vip.racnode.com. IN A 192.168.1.112
rac-scan.racnode.com. IN A 192.168.1.201
rac-scan.racnode.com. IN A 192.168.1.202
rac-scan.racnode.com. IN A 192.168.1.203

 

Step 5: Start the named service

 

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

[root@racnode1 named]# chkconfig named on

Step 6: resolv.conf looks like below

[root@racnode1 named]# cat /etc/resolv.conf

search racnode.com
nameserver 192.168.1.101
options timeout:1
options attempts:2

Step 6:

[root@racnode1 named]# nslookup rac-scan
Server: 192.168.1.101
Address: 192.168.1.101#53

Name: rac-scan.racnode.com
Address: 192.168.1.203
Name: rac-scan.racnode.com
Address: 192.168.1.201
Name: rac-scan.racnode.com
Address: 192.168.1.202

Step 7:  Go to  second node

[root@racnode2 ~]# service named status
named is stopped
[root@racnode2 ~]# cat /etc/resolv.conf
search racnode.com

nameserver 192.168.1.101

options timeout:1
options attempts:2

[root@racnode2 ~]# nslookup rac-scan
Server: 192.168.1.101
Address: 192.168.1.101#53

Name: rac-scan.racnode.com
Address: 192.168.1.201
Name: rac-scan.racnode.com
Address: 192.168.1.202
Name: rac-scan.racnode.com
Address: 192.168.1.203

 

Step 8: /etc/hosts file look like below on each node but don’t added scan address here

[root@racnode1 named]# 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
::1 localhost.localdomain localhost6 localhost
# Public
192.168.1.101 racnode1.racnode.com racnode1 racnode1
192.168.1.102 racnode2.racnode.com racnode2
# Private
10.10.1.1 racnode1-priv.racnode.com racnode1-priv
10.10.1.2 racnode2-priv.racnode.com racnode2-priv
# Virtual
192.168.1.111 racnode1-vip.racnode.com racnode1-vip
192.168.1.112 racnode2-vip.racnode.com racnode2-vip

 

Step 9:

[root@racnode1 named]# grep ^hosts /etc/nsswitch.conf
hosts: files dns

No comments yet

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

%d bloggers like this: