How-To Setup and Configure DNS Server for Oracle RAC
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:
- System: Xen VM
- CPU: 2VCPU
- RAM: 4 GB
- OS: CentOS 6
- 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
- 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
- Install DNS using command “yum install bind”
Configure DNS Server
After named installation, you will have to configure the DNS. Follow the below steps to create domain zone and records.
- Open /etc/named.conf file in your favorite editor, which will look like:
- 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; } - 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“
- 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. - Save and exit the DNS file i.e. /etc/named.conf
- 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 ) ; minimumIN 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 - Save and Exit the file
- 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 ) ; minimumIN 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. - Save and Exit the file
- Change the Ownership of created zone files using command “chown named.named *.zone“
- 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.
You must log in to post a comment.