DNS Configuration for the SCAN used with Oracle RAC Database


How to Configure DNS Server on OEL7 for RAC


Step by Step DNS Server Configuration


Step1:

Bind packages are required to configure DNS. Check whether the required bind packages are installed

                to see what packages are installed execute

rpm –qa bind*

            Install individual packages using yum or rpm Utility. Here I am using rpm

rpm -ivh bind-9.9.4-37.el7.x86_64.rpm
rpm -ivh bind-dyndb-ldap-10.0-5.el7.x86_64.rpm
rpm -ivh bind-libs-lite-9.9.4-37.el7.x86_64.rpm
rpm -ivh bind-utils-9.9.4-37.el7.x86_64.rpm
rpm -ivh bind-libs-9.9.4-37.el7.x86_64.rpm
rpm -ivh bind-chroot-9.9.4-37.el7.x86_64.rpm
rpm -ivh bind-license-9.9.4-37.el7.noarch.rpm
rpm -ivh bind-pkcs11-libs-9.9.4-37.el7.x86_64.rpm
rpm -ivh bind-pkcs11-9.9.4-37.el7.x86_64.rpm
rpm -ivh bind-pkcs11-utils-9.9.4-37.el7.x86_64.rpm


Step2:

Configure named.conf if not existing then create using vi /etc/named.conf
and modify exactly as shown below


options{
        directory "/var/named";
};
zone "oracle.com" {
        type master;
        file "oracle.com.zone";
        allow-transfer {192.9.1.1;};
};
zone "1.9.192.in-addr.arpa" {
        type master;
        file "1.9.192.in-addr.arpa.zone";
};

We have defined two zone files here oracle.com.zone for forward zone and 1.9.192.in-addr.arpa for reverse zone. These files will be stored in /var/named/ location. Configure these two files as below.



Step3:

Configure forward lookup zone file oracle.com.zone
modify or create the file /var/named/oracle.com.zone exactly as shown below


$TTL    86400
@                SOA           oracle.com.       root (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
@              NS              dns.oracle.com.
dns            A               192.9.1.102
node1          A               192.9.1.100
node2          A               192.9.1.101
storage        A               192.9.1.105
scan           A               192.9.1.120
scan           A               192.9.1.121
scan           A               192.9.1.122
node1-vip      A               192.9.1.150
node2-vip      A               192.9.1.151


Step4:

Configure reverse lookup zone file oracle.com.zone
modify or create the file /var/named/1.9.192.in-addr.arpa.zone exactly as shown below


$TTL    86400
@       IN      SOA     oracle.com. root.dns.oracle.com.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
        IN      NS      dns.oracle.com.
100     IN      PTR     node1.oracle.com.
101     IN      PTR     node2.oracle.com.
105     IN      PTR     storage.oracle.com.
150     IN      PTR     node1-vip.oracle.com.
151     IN      PTR     node2-vip.oracle.com.
120     IN      PTR     scan.
121     IN      PTR     scan.
122     IN      PTR     scan.


Step5:

Change the owner ship of these zone files to named group.


Step6:

Start named Service


systemctl start named.service
systemctl enable named.service


Step7:

Check if the named service is up and running

systemctl status named.service


How to Configure DNS Clients


Configuring DNS client is pretty easy just make an entry of your DNS server in /etc/resolv.conf

search  oracle.com
nameserver 192.9.1.102


As you can see in the screenshot below the scan IPs are resolved in round-robin fasion. This is the main reason to use DNS for scan Listener in RAC.




And hence target achieved..................Hurrrrrrrrreeeeeeeyyyyyyyyyyy.......







11 comments:

  1. what will be oracle.com in my case ? is it domain name ?

    ReplyDelete
  2. Or I should follow this manual as it to Configure SCAN?

    ReplyDelete
    Replies
    1. Hi
      Yes its domain name. you can have different domain name.
      For more posts you can catch me at https://onlinedbalearning.blogspot.com/

      Delete
  3. Hi Anand,

    nslookup is working from the dns server, while from other nodes its not working.

    ReplyDelete
  4. [root@node1 ~]# dig scan.oracle.com

    ; <<>> DiG 9.9.4-RedHat-9.9.4-72.el7 <<>> scan.oracle.com
    ;; global options: +cmd
    ;; connection timed out; no servers could be reached
    [root@node1 ~]# nslookup scan.oracle.com
    ;; connection timed out; no servers could be reached

    [root@node1 ~]# ssh dns
    root@dns's password:
    Last login: Sun Jul 14 14:05:12 2019 from node1.oracle.com
    [root@dns ~]# dig scan.oracle.com

    ; <<>> DiG 9.9.4-RedHat-9.9.4-72.el7 <<>> scan.oracle.com
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2031
    ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 1, ADDITIONAL: 2

    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ;; QUESTION SECTION:
    ;scan.oracle.com. IN A

    ;; ANSWER SECTION:
    scan.oracle.com. 86400 IN A 192.168.56.162
    scan.oracle.com. 86400 IN A 192.168.56.161
    scan.oracle.com. 86400 IN A 192.168.56.160

    ;; AUTHORITY SECTION:
    oracle.com. 86400 IN NS dns.oracle.com.

    ;; ADDITIONAL SECTION:
    dns.oracle.com. 86400 IN A 192.168.56.101

    ;; Query time: 1 msec
    ;; SERVER: 192.168.56.101#53(192.168.56.101)
    ;; WHEN: Sun Jul 14 14:11:16 IST 2019
    ;; MSG SIZE rcvd: 126

    [root@dns ~]#
    [root@dns ~]# nslookup scan.oracle.com
    Server: 192.168.56.101
    Address: 192.168.56.101#53

    Name: scan.oracle.com
    Address: 192.168.56.161
    Name: scan.oracle.com
    Address: 192.168.56.162
    Name: scan.oracle.com
    Address: 192.168.56.160

    [root@dns ~]#

    ReplyDelete
  5. [root@node1 ~]# cat /etc/resolv.conf
    # Generated by NetworkManager
    search oracle.com
    nameserver 192.168.56.101

    ReplyDelete