Dear All,
Environment Scenario:-
OS:- RHEL 5
DB :- 11gR2
Virtual Box:- Oracle Virtual Box
I am configuring 2node Oracle RAC config:-
Actually i don't have system admin that why i am confused with DNS configuration, which i done whether that is correct or not. I tried to configure DNS on my first node say rac1. Below is the mentioned config settings what i done;-
Step 1 : Login as root and install below listed Bind RPM's.
rpm -Uvh bind* --force --nodeps
rpm -Uvh system-config-bind* --force --nodeps
rpm -Uvh caching-nameserver* --force --nodeps
rpm -Uvh postgresql-libs* --force --nodeps
Step 2: Verify the IP address for the DNS server. Use following command to check the IP address.
[root@rac1 ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:7D:60:F3
inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe7d:60f3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:28 errors:0 dropped:0 overruns:0 frame:0
TX packets:39 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4919 (4.8 KiB) TX bytes:5628 (5.4 KiB)
Interrupt:67 Base address:0x2024
Step 3: There are four files we have to edit. Find the below easy steps to configure the DNS server.
- 1. Create a named.conf file using sample named.caching-nameserver.conf file.
[root@rac1 ~]# cd /var/named/chroot/etc/
[root@rac1 etc]# ls
localtime named.caching-nameserver.conf named.rfc1912.zones rndc.key
[root@dnc etc]#cp named.caching-nameserver.conf named.conf
2. Edit the named.conf file based on your configuration. For example.
options {
listen-on port 53 { 192.168.0.101; };
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";
// Those options should be used carefully because they disable port
// randomization
// query-source port 53;
// query-source-v6 port 53;
allow-query { 192.168.0.100/24; };
allow-query-cache { localhost; };
};
//logging {
// channel default_debug {
// file "data/named.run";
// severity dynamic;
// };
//};
//view localhost_resolver {
// match-clients { localhost; };
// match-destinations { localhost; };
// recursion yes;
// include "/etc/named.rfc1912.zones";
//};
zone "." IN {
type hint;
file "/dev/null";
};
zone "example.com" IN {
type master;
file "forward.zone";
};
zone "0.168.192.in-addr.arpa" IN {
type master;
file "reverse.zone";
};
3. Change the directory to below location
cd /var/named/chroot/var/named
cp localdomain.zone forward.zone
cp named.local reverse.zone
- 4. Change the permission to the above two files.
cd /var/named/chroot/etc
chgrp named named.conf
cd /var/named/chroot/var/named
chgrp named forward.zone
chgrp named reverse.zone
5. Modify the forward.zone file. example
[root@rac1 named]# vi forward.zone
$TTL 86400
@ IN SOA rac1 root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS rac1
IN A 192.168.0.171
rac1 IN A 192.168.0.171
rac2 IN A 192.168.0.172
rac3 IN A 192.168.0.173
rac1-priv IN A 192.168.1.171
rac2-priv IN A 192.168.1.172
rac3-priv IN A 192.168.1.173
rac1-vip IN A 192.168.0.174
rac2-vip IN A 192.168.0.175
rac3-vip IN A 192.168.0.176
scan IN A 192.168.0.177
scan IN A 192.168.0.178
scan IN A 192.168.0.179
- 7. Modify the reverse.zone file
[root@rac1 named]# vi reverse.zone
$TTL 86400
@ IN SOA rac1.example.com. root.rac1.example.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS rac1.example.com.
171 IN PTR rac1.example.com.
[root@server1 named]# vi /etc/resolv.conf
Add this line
-------------
nameserver 192.168.0.171
[root@server1 named]# service named restart
[root@server1 named]# chkconfig named on
[root@server1 named]# dig rac1.example.com
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5 <<>> rac1.example.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37009
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;rac1.example.com. IN A
;; ANSWER SECTION:
rac1.example.com. 86400 IN A 192.168.0.101
;; AUTHORITY SECTION:
- example.com. 86400 IN NS rac1.example.com.
;; Query time: 3 msec
;; SERVER: 192.168.0.101#53(192.168.0.101)
;; WHEN: Fri Feb 20 17:33:27 2015
;; MSG SIZE rcvd: 64
[root@rac1 etc]# dig -x 192.168.0.171
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5 <<>> -x 192.168.0.101
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58499
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; QUESTION SECTION:
;101.0.168.192.in-addr.arpa. IN PTR
;; ANSWER SECTION:
- 101.0.168.192.in-addr.arpa. 86400 IN PTR rac1.example.com.
;; AUTHORITY SECTION:
- 0.168.192.in-addr.arpa. 86400 IN NS rac1.example.com.
;; ADDITIONAL SECTION:
rac1.example.com. 86400 IN A 192.168.0.101
;; Query time: 3 msec
;; SERVER: 192.168.0.101#53(192.168.0.101)
;; WHEN: Fri Feb 20 17:41:02 2015
;; MSG SIZE rcvd: 104
[root@rac1 etc]# host 192.168.0.171
- 101.0.168.192.in-addr.arpa domain name pointer rac1.example.com.
[root@rac1 etc]# host rac1.example.com
rac1.example.com has address 192.168.0.101
[root@server1 named]# nslookup
> 192.168.0.171
Server: 192.168.0.101
Address: 192.168.0.101#53
- 101.0.168.192.in-addr.arpa name = rac1.example.com.
> rac1.example.com
Server: 192.168.0.101
Address: 192.168.0.101#53
Name: rac1.example.com
Address: 192.168.0.101
> exit
[root@server1 named]#
** Now Step By Step Configuration of Slave DNS Server **
Before Configure the Slave DNS, Master & Slave computers are should be
synchronize with Date/Time
(Means Both computer have same date and time)
Steps needed in Master Computer
-------------------------------
[root@server1 ~]# cd /var/named/chroot
[root@server1 chroot]# cd etc
[root@server1 etc]# vi named.conf
then add the following line
---------------------------
options {
.
.
.
allow-transfer { 192.168.0.172; }; // the ip address of Slave
machine
.
.
.
};
save and exit
:wq
[root@server1 etc]# cd ../var/named
[root@server1 named]# vi forward.zone
then add the IN NS and A entry as follows
-----------------------------------
IN NS rac2
IN A 192.168.0.172
rac2 IN A 192.168.0.102
save and exit
:wq
[root@server1 named]# vi reverse.zone
then add the IN NS and PTR entry as follows
-----------------------------------
IN NS rac2.example.com.
172 IN PTR rac2.example.com.
save and exit
:wq
Steps needed in Slave Computer
-------------------------------
[root@station1 ~]# rpm -Uvh bind* --force --nodeps
rpm -Uvh system-config-bind* --force --nodeps
rpm -Uvh caching-nameserver* --force --nodeps
rpm -Uvh postgresql-libs* --force --nodeps
[root@station1 ~]# cd /var/named/chroot
[root@station1 chroot]# cd etc
[root@station1 etc]# cp named.caching-nameserver.conf named.conf
[root@station1 etc]# cat named.rfc1912.zones >> named.conf
[root@station1 etc]# chgrp named named.conf
[root@station1 etc]# vi named.conf
Change the following lines
--------------------------
.
.
listen-on port 53 { 192.168.0.172 }; //ip adderss of the
system
.
.
.
.
allow-query { 192.168.1.0/24; }; //Network address
.
.
Make comment of these lines
---------------------------
// logging {
// channel default_debug {
// file "data/named.run";
// severity dynamic;
// };
// };
// view localhost_resolver {
// match-clients { localhost; };
// match-destinations { localhost; };
// recursion yes;
// include "/etc/named.rfc1912.zones";
// };
Add the following lines
-----------------------
zone "example.com" IN {
type slave;
masters { 192.168.0.171; };
file "slaves/forward.zone";
};
zone "1.168.192.in-addr.arpa" IN {
type slave;
masters { 192.168.0.171; };
file "slaves/reverse.zone";
};
Save and exit the file
----------------------
:wq
[root@station1 named]# vi /etc/resolv.conf
Add this line
-------------
nameserver 192.168.0.171
[root@station1 named]# service named restart
[root@station1 named]# chkconfig named on
Anyone of you Guru's can please let me know whether i am using correct configuration or not