- yum install -y *bind* caching-nameserver
cd /var/named/chroot/etc/
- cp named.caching-nameserver.conf named.conf
vi named.conf
[root@ovmd1 etc]# vi named.conf
//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver package to configure the
// ISC BIND named(8) DNS server as a caching only nameserver
// (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//
options {
listen-on port 53 { 192.168.0.103; };
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 { any; };
allow-query-cache { any; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients { any; };
match-destinations { 192.168.0.103; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
[root@ovmd1 etc]# cat named.rfc1912.zones
// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
zone "." IN {
type hint;
file "named.ca";
};
zone "example.com" IN {
type master;
file "forward.zone";
allow-update { none; };
};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "0.168.192.in-addr.arpa" IN {
type master;
file "reverse.zone";
allow-update { none; };
};
zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
type master;
file "named.ip6.local";
allow-update { none; };
};
zone "255.in-addr.arpa" IN {
type master;
file "named.broadcast";
allow-update { none; };
};
zone "0.in-addr.arpa" IN {
type master;
file "named.zero";
allow-update { none; };
};
chgrp named named.conf
cd /var/named/chroot/var/named/
cp localdomain.zone forward.zone
[root@ovmd1 etc]# cd /var/named/chroot/var/named/
[root@ovmd1 named]# cat forward.zone
$TTL 86400
@ IN SOA ovmd1.example.com. root.example.com. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS ovmd1.example.com.
ovmd1 IN A 192.168.0.103
; Oracle RAC Nodes
ovmd1 IN A 192.168.0.103
ovmd2 IN A 192.168.0.104
ovmd1-priv IN A 192.168.56.103
ovmd2-priv IN A 192.168.56.104
ovmd1-vip IN A 192.168.0.251
ovmd2-vip IN A 192.168.0.252
ovmapp IN A 192.168.0.105
; Single Client Access Name (SCAN) virtual IP
rac-cluster-scan IN A 192.168.0.150
rac-cluster-scan IN A 192.168.0.151
rac-cluster-scan IN A 192.168.0.152
[root@ovmd1 named]# cat reverse.zone
$TTL 86400
@ IN SOA ovmd1.example.com. root.ovmd1.example.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS ovmd1.example.com.
103 IN PTR ovmd1.example.com.
; Oracle RAC Nodes
103 IN PTR ovmd1.example.com.
104 IN PTR ovmd2.example.com.
105 IN PTR ovmapp.example.com.
251 IN PTR ovmd1-vip.example.com.
252 IN PTR ovmd2-vip.example.com.
; Single Client Access Name (SCAN) virtual IP
150 IN PTR rac-cluster-scan.example.com.
151 IN PTR rac-cluster-scan.example.com.
152 IN PTR rac-cluster-scan.example.com.
chgrp named forward.zone
chgrp named reverse.zone
- Insert into all the nodes.
[root@ovmd1 named]# cat /etc/resolv.conf
search example.com
nameserver 192.168.0.103
service named restart
Stopping named: [ OK ]
Starting named: [ OK ]
[root@ovmd1 named]# dig ovmd1
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-20.P1.el5_8.6 <<>> ovmd1
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 27297
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;ovmd1. IN A
;; AUTHORITY SECTION:
. 10800 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2013062301 1800 900 604800 86400
;; Query time: 5150 msec
;; SERVER: 192.168.0.103#53(192.168.0.103)
;; WHEN: Sun Jun 23 22:23:24 2013
;; MSG SIZE rcvd: 98
chkconfig named on
chkconfig named –list
named 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@ovmd1 named]# nslookup rac-cluster-scan
Server: 192.168.0.103
Address: 192.168.0.103#53
Name: rac-cluster-scan.example.com
Address: 192.168.0.150
Name: rac-cluster-scan.example.com
Address: 192.168.0.151
Name: rac-cluster-scan.example.com
Address: 192.168.0.152
- To prevent the entry in /etc/resolv.conf from being overwritten do ;
chattr +i /etc/resolv.conf
Should now be able to create your two node cluster;