Configuring DNS Server on Oracle Linux 7.5 (For Oracle RAC)

0
113

To install and configure Oracle RAC (11gR2+), we know that we need a DNS server for Scan IP resolution. Ofcourse, using /etc/hosts we can manage but obviously every customer uses DNS. In this post, we will be seeing how to configure DNS Server on Oracle Linux 7.5 for RAC. It is really a simple process.

First install Oracle Linux 7 and install the bind rpm:

yum install bind

Edit /etc/hosts

127.0.0.1   localhost localhost.localdomain
192.168.56.200 dns.vishnu.ae dns

Now edit /etc/named.conf. I made only 3 changes in named.conf. They are highlighted below:

options {
listen-on port 53 { 127.0.0.1; 192.168.56.200; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
recursing-file "/var/named/data/named.recursing";
secroots-file "/var/named/data/named.secroots";
allow-query { localhost; 192.168.56.0/24; };

Now add the below forward and reverse lookup configuration at the end of the named.conf:

zone "." IN {
type hint;
file "named.ca";
};

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

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


include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

So this means the forward lookup file name is vishnu.ae.zone and the reverse lookup file name is 56.168.192.in-addr.arpa. Create these 2 files in /var/named as below:

[root@dns ~]# cat /var/named/vishnu.ae.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
racs1 IN A 192.168.56.101
racs2 IN A 192.168.56.102
racs1-priv IN A 192.168.1.101
racs2-priv IN A 192.168.1.102
racs1-vip IN A 192.168.56.111
racs2-vip IN A 192.168.56.112
racs-scan IN A 192.168.56.121
racs-scan IN A 192.168.56.122
racs-scan IN A 192.168.56.123

[root@dns ~]# cat /var/named/56.168.192.in-addr.arpa
$ORIGIN 56.168.192.in-addr.arpa.
$TTL 1H
@ IN SOA dns.vishnu.ae. root.dns.vishnu.ae. ( 2
3H
1H
1W
1H )
56.168.192.in-addr.arpa. IN NS dns.vishnu.ae.
101 IN PTR racs1.vishnu.ae.
102 IN PTR racs2.vishnu.ae.
111 IN PTR racs1-vip.vishnu.ae.
112 IN PTR racs2-vip.vishnu.ae.
121 IN PTR racs-scan.vishnu.ae.
122 IN PTR racs-scan.vishnu.ae.
123 IN PTR racs-scan.vishnu.ae.

So we basically created the DNS entries for RACS1 and RACS2 nodes where the scan name is RACS-SCAN. Now simply restart the named service:

systemctl restart named

Then run below nslookup commands to verify forward and reverse lookup name resolution:

[root@dns ~]# nslookup racs1.vishnu.ae
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: racs1.vishnu.ae
Address: 192.168.56.101
[root@dns ~]# nslookup 192.168.56.101
Server: 127.0.0.1
Address: 127.0.0.1#53
101.56.168.192.in-addr.arpa name = racs1.vishnu.ae.

Disable the firewall in your Oracle Linux 7:

systemctl disable firewalld

LEAVE A REPLY

Please enter your comment!
Please enter your name here