How-To Setup and Configure DNS Server for Oracle RAC

By: Published: Aug 15th, 2013 Category: Linux Tips, Oracle

DNS setup is a important part of Oracle (11g 2RAC) configuration as it is used for Single Client Access Name (SCAN). In this post I am going to explain how you can configure DNS server for Oracle RAC. I have created two Cirtix XEN based VM and installed Oracle Database on them. I have created a Third VM on which DNS Services (Bind) would be installed and configured.

System configuration:

  1. System: Xen VM
  2. CPU: 2VCPU
  3. RAM: 4 GB
  4. OS: CentOS 6
  5. HDD: 20 GB

Domain Configuration: To configure the DNS I have used domain “oracledns.com” and I will configure following DNS :

database1.oracledns.com – 10.10.10.2
database2.oracledns.com – 10.10.10.3
database1-priv.oracledns.com – 192.168.0.1
database2-priv.oracledns.com – 192.168.0.2
database1-vip.oracledns.com – 10.10.10.16
database2-vip.oracledns.com – 10.10.10.17
orac-scan.oracledns.com – 10.10.10.18
orac-scan.oracledns.com – 10.10.10.19
orac-scan.oracledns.com – 10.10.10.20

Installation of DNS Server

  1. Check if DNS is already installed or not by using command “rpm -qa|grep -i bind“. If you see following result then DNS is already installed on your server and you can skip the next step 1 How To Setup and Configure DNS Server for Oracle RAC
  2. Install DNS using command “yum install bind
    install bing using yum 1024x503 How To Setup and Configure DNS Server for Oracle RAC

Configure DNS Server

After named installation, you will have to configure the DNS. Follow the below steps to create domain zone and records.

  1. Open /etc/named.conf file in your favorite editor, which will look like:
    named.conf  How To Setup and Configure DNS Server for Oracle RAC
  2. Make following changes in named.conf file
    a) Listen-on: Add the IP of local server on which DNS port which will be answered.
    b) Allow-query: change the from { localhost; } to { any; }
  3. Configure DNS zones(Forward Lookup): Now we will have to create zone files in which DNS records will be configured. Add following lines in named.conf file.

    zone “oracledns.com” IN {
    type master;
    file “oracledns.com.zone”;
    allow-update { none; };
    };

    Now we will have to create a zone file with name “oracledns.com.zone

  4. Configure DNS zones(Reverse Lookup): After adding Forward lookup we will now have to configure reverse DNS. Add following in named.conf file:

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

    Here, in my setup I am using two different IP subnet’s for databases, they are 10.10.10.x and 192.168.0.x. I have added records for “10.10.10.in-addr.arpa.zone” as well.
    NOTE: If you are using more than one IP subnet’s you will have add reverse DNS for each and every subnet.

  5. Save and exit the DNS file i.e. /etc/named.conf
  6. Setup DNS Zone -1 (Forward Lookup): Now we will create the files (zones) which we have mentioned in named.conf. Go to /var/named directory and create a blank file named “oracledns.com.zone”. Now open this file in your favorite  editor and add following:

    $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              127.0.0.1
    database1          IN                        A              10.10.10.2
    database2          IN                        A              10.10.10.3
    database1-priv     IN                        A              192.168.0.1
    database2-priv     IN                        A              192.168.0.2
    database1-vip      IN                        A              10.10.10.16
    database2-vip      IN                        A              10.10.10.17
    orac-scan          IN                        A              10.10.10.18
    orac-scan          IN                        A              10.10.10.19
    orac-scan          IN                        A              10.10.10.20

  7. Save and Exit the file
  8. Setup DNS Zone -2 (Reverse Lookup): Now create zone file for each and every IP in reverse (as mentioned in named.conf) and add following in respective files (following records are for 10.10.10.in-addr.arpa.zone)

    $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              127.0.0.1
    2             IN              PTR             database1.oracledns.com.
    3             IN              PTR             database2.oracledns.com.
    16            IN              PTR             database1-vip.oracledns.com.
    17            IN              PTR             database2-vip.oracledns.com.
    18            IN              PTR             orac-scan.oracledns.com.
    19            IN              PTR             orac-scan.oracledns.com.
    20            IN              PTR             orac-scan.oracledns.com.

  9. Save and Exit the file
  10. Change the Ownership of created zone files using command “chown named.named *.zone
  11. Restart DNS Server: “service named restart

Note: Make sure to add the DNS Server IP as resolver (/etc/resolv.conf) in all the server in Oracle Cluster and remove other IP’s.

 How To Setup and Configure DNS Server for Oracle RAC

About 

Milind Koyande is a Project Manager and his job is to work with new technologies, specially Cloud Computing / Virtualization Technology. His past projects include Government Sector initiatives, Backup and Disaster Recovery Solutions.

Tags: , , ,

Leave a Reply

Subscribe to eITWebguru

© 2012 eITWebguru. All Rights Reserved.