Thinking Out Loud

April 19, 2013

DNS for RAC on VirtualBox

Filed under: 11g,linux,RAC — mdinh @ 4:44 am

Just completed RAC training and wanted to put into practice.

SCAN IPs MUST NOT be in the /etc/hosts file because it will result in only 1 SCAN IP for the entire cluster.

I started looking for simple DNS server to be used with RAC and came across dnsmasq.

LINUX VERSION

[root@rac01 ~]# uname -an
Linux rac01.localdomain 2.6.39-200.24.1.el6uek.x86_64 #1 SMP Sat Jun 23 02:39:07 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux

HOSTS

[root@rac01 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
#NAT (VBox)
#eth0 (DHCP)
#Internal Networking (VBox)
#Private eth2
10.10.10.11    rac01-priv  rac01-priv.localdomain
10.10.10.12    rac02-priv  rac02-priv.localdoamin
#Host Networking (VBox)
#Public eth1
192.168.56.11  rac01       rac01.localdomain
192.168.56.12  rac02       rac02.localdomain
#Virtual IP
192.168.56.21  rac01-vip   rac01-vip.localdomain
192.168.56.22  rac02-vip   rac02-vip.localdomain
#SCAN IP
#192.168.56.31  scan        scan.localdomain
#192.168.56.32  scan        scan.localdomain
#192.168.56.33  scan        scan.localdomain
[root@rac01 ~]#

INSTALATION

yum install dnsmasq

VERIFY INSTALLATION

[root@rac01 ~]# yum list dnsmasq
Loaded plugins: refresh-packagekit, security
Installed Packages
dnsmasq.x86_64     2.48-13.el6     @ol6_latest

[root@rac01 ~]# rpm -qa dnsmasq
dnsmasq-2.48-13.el6.x86_64

ADD IP to resolv.conf MUST BE FIRST LINE

[root@rac01 ~]# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.56.11
domain gateway.2wire.net
search gateway.2wire.net localdomain
nameserver 172.16.0.1

WRITE PROTECTING /etc/resolv.conf FILE – resolve.conf changed on reboot due to DHCP

chattr +i /etc/resolv.conf

CONFIGURE dnsmasq

[root@rac01 ~]# cat /etc/dnsmasq.conf
listen-address=192.168.56.11
port=53
no-resolv
domain-needed
bogus-priv
dns-forward-max=150
cache-size=1000
neg-ttl=3600
no-poll
no-hosts
addn-hosts=/etc/racdns

CREATE DNS ENTRIES

[root@rac01 ~]# cat /etc/racdns 
192.168.56.31  scan        scan.localdomain
192.168.56.32  scan        scan.localdomain
192.168.56.33  scan        scan.localdomain
192.168.56.11  rac01       rac01.localdomain
192.168.56.12  rac02       rac02.localdomain
192.168.56.21  rac01-vip   rac01-vip.localdomain
192.168.56.22  rac02-vip   rac02-vip.localdomain

TEST NSLOOKUP

[root@rac01 ~]# nslookup scan
Server:		192.168.56.11
Address:	192.168.56.11#53

Name:	scan.localdomain
Address: 192.168.56.33
Name:	scan.localdomain
Address: 192.168.56.31
Name:	scan.localdomain
Address: 192.168.56.32

[root@rac01 ~]# nslookup scan
Server:		192.168.56.11
Address:	192.168.56.11#53

Name:	scan.localdomain
Address: 192.168.56.31
Name:	scan.localdomain
Address: 192.168.56.32
Name:	scan.localdomain
Address: 192.168.56.33

[root@rac01 ~]# nslookup scan
Server:		192.168.56.11
Address:	192.168.56.11#53

Name:	scan.localdomain
Address: 192.168.56.32
Name:	scan.localdomain
Address: 192.168.56.33
Name:	scan.localdomain
Address: 192.168.56.31

[root@rac01 ~]# nslookup rac01
Server:		192.168.56.11
Address:	192.168.56.11#53

Name:	rac01.localdomain
Address: 192.168.56.11

[root@rac01 ~]# nslookup rac02
Server:		192.168.56.11
Address:	192.168.56.11#53

Name:	rac02.localdomain
Address: 192.168.56.12

[root@rac01 ~]# nslookup rac01-vip
Server:		192.168.56.11
Address:	192.168.56.11#53

Name:	rac01-vip.localdomain
Address: 192.168.56.21

[root@rac01 ~]# nslookup rac02-vip
Server:		192.168.56.11
Address:	192.168.56.11#53

Name:	rac02-vip.localdomain
Address: 192.168.56.22

ADD SERVICE RESTART

[root@rac01 ~]# /sbin/chkconfig dnsmasq on
[root@rac01 ~]# /sbin/chkconfig dnsmasq --list
dnsmasq        	0:off	1:off	2:on	3:on	4:on	5:on	6:on

MANUAL SERVICE RESTART

[root@rac01 ~]# /etc/init.d/dnsmasq restart
Shutting down dnsmasq:                                     [  OK  ]
Starting dnsmasq:                                          [  OK  ]
About these ads

1 Comment »

  1. Nice one man :).

    Comment by goryszewskig — April 27, 2013 @ 4:02 pm | Reply


RSS feed for comments on this post. TrackBack URI

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

The Rubric Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 314 other followers

%d bloggers like this: