Build your own 11.2 RAC system-part I: DNS

As many of you already know, Oracle released 11g Release 2 of the database for Linux x86 and x86-64. That is really cool and this time I don’t want to miss out on researching some new features of the new release. I have spent some time reading up about 11.2 and for what it’s worth I’d consider it more of a step forward compared to 11.1 which IMO is just a glorified with a lot of cost options. But I disgress….

The reason of this post is to allow the reader to set up his own DNS server for building an 11.2 RAC system. As you may know, 11.2 uses DNS for two main purposes:

  1. Grid Plug and Play
  2. Single Client Access Name (SCAN)

Grid Plug and Play is something I’ll look at later so let’s focus on the SCAN addresses. The documentation states that we should at least provide 3 IP addresses for a single SCAN name which will be used in a round robin fashion (reference: Section IP Address Requirements for Manual Configuration in the Grid Infrastructure Installation Guide for Linux).

Huh? Are the DBAs now tasked with DNS administration? Probably not, but it doesn’t hurt understanding the concepts, especially if you are like me and want a RAC cluster in your lab environment.

DNS and Linux

I initially looked at DNS when still at the University which seems like a long time ago nowadays. Back then Linux was the uni’s preferred non-Windows platform so I knew which package to install. The following example uses bind 9.3.4-6P1.el5 which is the unpatched DNS server distributed with RHEL 5 update 2.

A word of caution: this article shouldn’t be used to set up a production DNS server, it’s merely intended to get you a DNS server for a lab environment!

With all that said, let’s proceed to getting our SCAN addresses registered. First of all, use rpm to install the package.

Once that’s installed, we need to configure our DNS server. bind9 comes with a number of sample configuration files which make our life a little easier. Traditionally, bind is configured in 2 places:

  • /etc/named.conf for the zone definition and
  • /var/named for the zone configuration.


Let’s look at /etc/named.conf first. Please check the documentation and/or man page for the file if you need more explanation.

This file contains the zones as recommended by RFC 1912 section 4.1 (part of the sample configuration) and my zone “”. I want to resolve all hostnames ending in from the DNS server. Consider this file:

 /* make named use port 53 for the source of all queries, to allow
 * firewalls to block all ports except 53:
 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";

 allow-transfer {"none";};
 zone-statistics yes;


 channel default_debug {
 file "data/";
 severity dynamic;

zone "" IN {
 type master;
 file "";
 //allow-transfer {;};
 notify no;

zone "" IN {
 type master;
 file "the-playground.reverse";
 //allow-update { none; };
 //allow-transfer {;};
 notify no;

// the following is recommended and not my stuff
// named.rfc1912.zones:

zone "localdomain" IN {
 type master;
 file "";
 allow-update { none; };

zone "localhost" IN {
 type master;
 file "";
 allow-update { none; };

zone "" IN {
 type master;
 file "named.local";
 allow-update { none; };

zone "" IN {
 type master;
 file "named.ip6.local";
 allow-update { none; };

zone "" IN {
 type master;
 file "named.broadcast";
 allow-update { none; };

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

The file is a copy & paste effort with emphasis of getting it to work rather than a beautiful engineering effort. Copy the files referenced by the file directive from /usr/share/doc/bind-9.3.4/sample/var/named to /var/named. The files “the-playground.reverse” and “” need to be created, see below. Please also rename the zones to whatever you fancy. If you wonder why there are 2 directives for the same domain – that has to do with forward and reverse address resolution. DNS needs to be able to do 2 things:

  1. Resolve name to IP address
  2. Reverse the process, converting IP addresses to names.

So when you type in “ping” DNS will translate this to “ping”. Also, you can ask DNS which hostname is behind a specific IP using the nslookup tool. dig and host are some more tools you could use for troubleshooting.

The file has the following contents:

$TTL    86400
@        IN SOA (
                 42        ; serial (d. adams)
                 3H        ; refresh
                15M        ; retry
                 1W        ; expiry
               1D )        ; minimum
                IN NS   node1
node1           IN A
node1v          IN A
node2           IN A
node2v          IN A
node3           IN A
node3v          IN A

scan-cluster    IN A
scan-cluster    IN A
scan-cluster    IN A

Here we are assigning names to IP addresses. The reverse is done in the reverse zone file. Just change names and IP addresses to fit your needs.

I had an undetected problem with the file, in a way that the PTR wasn’t the FQDN of the host which caused reverse lookups to return incorrect results. This has now been fixed.


Consider this file:

$TTL    86400
@        IN SOA (
                   42        ; serial (d. adams)
                   3H        ; refresh
                  15M        ; retry
                   1W        ; expiry
                 1D )        ; minimum
                IN NS
10              IN PTR
11              IN PTR
20              IN PTR
21              IN PTR
30              IN PTR
31              IN PTR

100             IN PTR
101             IN PTR
102             IN PTR

Starting and using named

With the files in place, start named using service named start. Check /var/log/messages for potential problems (usually typos) and correct them. Configuration changes are made available through service named reload.

Edit /etc/resolv.conf on your RAC nodes, they need the following entries:

options attempts: 2
options timeout: 1


Change IP addresses for your environment. Also, edit /etc/nsswitch conf’s hosts directive to favour dns over files, i.e. make sure the line beginning “hosts” reads hosts: dns files

That’s it! We’re well underway to set up our first 11.2 cluster!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your 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