8i | 9i | 10g | 11g | 12c | Misc | PL/SQL | SQL | RAC | Linux

Home » Articles » Linux » Here

DNS Configuration for the SCAN used with Oracle RAC Database 11g Release 2

This article provides the basic DNS configuration steps necessary to use the Single Client Access Name (SCAN) introduced in Oracle 11g Release 2 RAC. Please consider the following caveats before following the instructions here:

With those caveats in mind, here's what you need to do.

Related articles.

DNS Installation

If you are using a free Linux distribution, like Fedora, then you probably already have a YUM repository configured. If you are using Oracle Linux, then follow the configuration instructions on public-yum.oracle.com.

Installation of the DNS server (BIND) could not be simpler. From the command line issue the following command.

# yum install bind-libs bind bind-utils

If you want a GUI DNS editor, you can also install the following package. Personally, I find the GUI editor more confusing than using the configuration files directly.

# yum install system-config-bind

Note. If the config files are not present (as is the case in Oracle Linux 5), it is worth installing the "system-config-bind" utility and starting it up. This will generate a default setup of all the dependent config files for you to amend. It is much easier than trying to build them manually.

"/etc/named.conf" File

Next we must edit the contents of the "/etc/named.conf" file. Depending on the setup you require, you may need to make lots of changes, or none at all. For my home network I use "localdomain" as my domain and the IP range "192.168.0.*", so this is what I will show here.

We need to make sure the DNS is listening on the correct port for both the local and external IP address. This is done by the "listen-on" setting. This DNS server is only resolving the names of the servers on my network, so I need to make sure that servers on external networks, like the internet, are resolved properly. To do this you add a "forwarder" entry to the end of the "options" section.

options {
        // Set IP address correctly.
        listen-on port 53 {;; };

        // Leave the rest of the config as it is.

        // My Additions
        // Forwarder: Anything this DNS can't resolve gets forwarded to my ISPs DNS.
        forwarders {;; };
	// End My Additions

In this case I'm using the DNS information provided by my ISP, but you could list your ADSL Router if it manages the DNS for you.

Since I'm using "localdomain" as my internal domain, I need to add a zone if one isn't already present.

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

If you plan to use a different domain simply copy this entry and adjust it to match your domain. For example, if this were an entry for "oracle-base.com" I would create a zone as follows.

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

The "file" parameter specifies the name of the file in the "/var/named/" directory that contains the configuration for this zone.

If you only care about forward lookups then you are now finished with the "/etc/named.conf" file. If you want to also cope with reverse lookups you will need to add an extra zone to cope with those. In the case of a RAC installation, I want to create reverse lookups for my public (192.169.0.*) network, so I must add the following zone entry.

zone "0.168.192.in-addr.arpa." IN {
        type master;
        file "0.168.192.in-addr.arpa";
        allow-update { none; };

Examples of the amended default "/etc/named.conf" files can be seen below.

"/var/named/" Files

In the zone definitions we defined the file containing the zone configuration. These files are located in the "/var/named/" directory. If you are using the "chroot" version of BIND, the location of the following files will be "/var/named/chroot/var/named".

For a RAC installation create/edit the file associated with your zone (in my case "/var/named/localdomain.zone") to look like the one below.

$TTL    86400
@               IN SOA  localhost root.localhost (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
                IN NS           localhost
localhost       IN A  
rac1            IN A
rac2            IN A
rac1-priv       IN A
rac2-priv       IN A
rac1-vip        IN A
rac2-vip        IN A
rac-scan        IN A
rac-scan        IN A
rac-scan        IN A

I've kept all the default configuration, but added in my forward lookup information. Notice the three entries for the SCAN.

Next I need to create the "/var/named/0.168.192.in-addr.arpa" file for my public network reverse lookups. This file has the following contents, where "maggie.localdomain" is the name of the DNS server.

$ORIGIN 0.168.192.in-addr.arpa.
@       IN      SOA     maggie.localdomain.     root.maggie.localdomain. (      2
                                                1H )
0.168.192.in-addr.arpa.         IN NS      maggie.localdomain.

101     IN PTR  rac1.localdomain.
102     IN PTR  rac2.localdomain.
111     IN PTR  rac1-vip.localdomain.
112     IN PTR  rac2-vip.localdomain.
121     IN PTR  rac-scan.localdomain.
122     IN PTR  rac-scan.localdomain.
123     IN PTR  rac-scan.localdomain.

Start the DNS Service

With the configuration in place we can start the DNS service, called "named".

# service named start
Starting named:                                            [  OK  ]

If there are any problems with your configuration the service will fail to start and the errors should be displayed on screen immediately. If they don't appear check the "/var/log/messages" file.

Issue the following command to make sure the "named" service starts automatically after reboots.

# chkconfig named on

"/etc/resolv.conf" File

The DNS server is now running, but each server must be told to use it. This is done by editing the "/etc/resolv.conf" file on each server, including the RAC nodes. Make sure the file contains the following entries, where the IP address and domain match those of your DNS server and the domain you have configured.

search localdomain

Test It

You should now be able to test the forward and reverse lookups using the "nslookup" command. The output below shows the forward and reverse lookups of the SCAN address.

# nslookup rac-scan.localdomain

Name:   rac-scan.localdomain
Name:   rac-scan.localdomain
Name:   rac-scan.localdomain

# nslookup
Address:      name = rac-scan.localdomain.

# nslookup
Address:      name = rac-scan.localdomain.

# nslookup
Address:      name = rac-scan.localdomain.


For more information see:

Hope this helps. Regards Tim...

Back to the Top.