Configure DNS Server In ORACLE RAC

By default, operating system uses the dns server configured in /etc/resolv.conf and for each lookup it’ll go for the same set of servers, however using dnsmasq we can use different dns server for specific domains.

IP

NODE 1

NODE 2

PUBLIC IP

192.168.10.11

192.168.10.12

PRIVATE IP

192.168.24.28

192.168.24.29

VIP

192.168.10.31

192.168.10.32

SCAN IP

192.168.10.58/192.168.10.59/192.168.10.60

Same Across The Cluster


DNS SERVER

NODE  1

NODE 2

oratest.localdomain

oratest.localdomain

oratest2.localdomain


NOTE: we can use the same server for dns configuration and RAC node 1 configuration.

 

STEP 1:  Since dnsmasq read hostfile. So, make an entry of all the IPs in /etc/hosts file

 

[root@oratest ~]# cat /etc/hosts

 

127.0.0.1     localhost.localdomain  localhost


# Public

192.168.10.11       oratest                   oratest.localdomain

192.168.10.12       oratest2      oratest2.localdomain

 

# Private

192.168.24.28      oratest-priv          oratest-priv.localdomain 

192.168.24.29      oratest2-priv        oratest2-priv.localdomain

 

# Virtual

192.168.10.31       oratest-vip oratest-vip.localdomain 

192.168.10.32      oratest2-vip         oratest2-vip.localdomain

 

# SCAN

192.168.10.58      oratest-scan         oratest-scan.localdomain

192.168.10.59      oratest-scan         oratest-scan.localdomain

192.168.10.60      oratest-scan         oratest-scan.localdomain

 

STEP 2: Install dnsmasq package

 

[root@oratest ~]# yum install dnsmasq

 

Oracle Linux 8 BaseOS Latest (x86_64)                                                                                                                                               14 kB/s | 3.6 kB     00:00   

Oracle Linux 8 BaseOS Latest (x86_64)                                                                                                                                               24 MB/s |  69 MB     00:02   

Oracle Linux 8 Application Stream (x86_64)                                                                                                                                          50 kB/s | 3.9 kB     00:00   

Oracle Linux 8 Application Stream (x86_64)                                                                                                                                          23 MB/s |  54 MB     00:02   

Latest Unbreakable Enterprise Kernel Release 7 for Oracle Linux 8 (x86_64)                                                                                                          18 kB/s | 3.0 kB     00:00   

Last metadata expiration check: 0:00:01 ago on Fri 23 Feb 2024 11:33:37 PM IST.

Package dnsmasq-2.79-26.el8.x86_64 is already installed.

Dependencies resolved.

===================================================================================================================================================================================================================

 Package                                         Architecture                                   Version                                                Repository                                             Size

===================================================================================================================================================================================================================

Upgrading:

 dnsmasq                                         x86_64                                         2.79-31.el8                                            ol8_appstream                                         322 k

 

Transaction Summary

===================================================================================================================================================================================================================

Upgrade  1 Package

 

Total download size: 322 k

Is this ok [y/N]: y

Downloading Packages:

dnsmasq-2.79-31.el8.x86_64.rpm                                                                                                                                                     2.0 MB/s | 322 kB     00:00   

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Total                                                                                                                                                                              2.0 MB/s | 322 kB     00:00    

Running transaction check

Transaction check succeeded.

Running transaction test

Transaction test succeeded.

Running transaction

  Preparing        :                                                                                                                                                                                           1/1

  Running scriptlet: dnsmasq-2.79-31.el8.x86_64                                                                                                                                                                1/1

  Running scriptlet: dnsmasq-2.79-31.el8.x86_64                                                                                                                                                                1/2

  Upgrading        : dnsmasq-2.79-31.el8.x86_64                                                                                                                                                                1/2

  Running scriptlet: dnsmasq-2.79-31.el8.x86_64                                                                                                                                                                1/2

  Running scriptlet: dnsmasq-2.79-26.el8.x86_64                                                                                                                                                                2/2

  Cleanup          : dnsmasq-2.79-26.el8.x86_64                                                                                                                                                                2/2

  Running scriptlet: dnsmasq-2.79-26.el8.x86_64                                                                                                                                                                2/2

  Verifying        : dnsmasq-2.79-31.el8.x86_64                                                                                                                                                                1/2

  Verifying        : dnsmasq-2.79 26.el8.x86_64                                                                                                                                                                2/2

Upgraded:

  dnsmasq-2.79-31.el8.x86_64                                                                                                                                                                                      

 Complete!


STEP 3: Enable dnsmasq service at system boot

 

[root@oratest ~]# systemctl enable dnsmasq.service

 

Created symlink /etc/systemd/system/multi-user.target.wants/dnsmasq.service → /usr/lib/systemd/system/dnsmasq.service.

 

STEP 4: create a file under /etc directory to read scan IPs by dns server

 

[root@oratest ~]# cat /etc/racdns

 

# SCAN

192.168.10.58      oratest-scan         oratest-scan.localdomain

192.168.10.59      oratest-scan         oratest-scan.localdomain

192.168.10.60      oratest-scan         oratest-scan.localdomain

 

STEP 5: Take backup of /etc/dnsmasq.conf file

 

[root@oratest ~]# cp /etc/dnsmasq.conf /etc/dnsmasq.conf_orig

[root@oratest ~]# ls -ltr /etc/dnsmasq.*

-rw-r--r--. 1 root dnsmasq 26843 Oct 14 11:17 /etc/dnsmasq.conf

-rw-r--r--. 1 root root    26843 Feb 23 23:37 /etc/dnsmasq.conf_orig

 

 STEP 6: Edit dnsmasq.conf file and adjust below settings











NOTE: By default, All the above parameter are commented in dnsmasq.conf file , we’ve to uncomment it prior to set it to a specific values

  

STEP 7: Start dnsmasq service

[root@oratest ~]# systemctl start dnsmasq.service

  

STEP 8: Validate status of dnsmasq.service




STEP 9: Replace the current nameserver in /etc/resolv.conf with 127.0.0.1 ( dnsmasq is listening there )

 

[root@oratest ~]# cat /etc/resolv.conf

 

# Generated by NetworkManager

search localdomain

nameserver 127.0.0.1


STEP 10: Enable chattr in /etc/resolve.conf


[root@oratest ~]# chattr +i /etc/resolv.conf

 

STEP 11: Validate Scan IP must run in round-robin fashion in each and every nslookup






 

Post a Comment

Previous Post Next Post