Files for Name Server Setup

 

Here are the files I used to setup my named server for Oracle RAC scan ip.

I setup a VM server called app1, which I plan to have host my Name Server, Web Server, OEM Grid Control.

In the /etc/hosts file I have the following:

127.0.0.1 localhost.localdomain localhost loopback
192.168.56.11 rac1.localdomain rac1
192.168.56.21 rac2.localdomain rac2
192.168.56.31 rac1-sb.localdomain sb-rac1
192.168.56.41 rac2-sb.localdomain sb-rac2
192.168.56.51 app1.localdomain app1
192.168.57.11 rac1-priv.localdomain rac1-priv
192.168.57.21 rac2-priv.localdomain rac2-priv
192.168.57.31 rac1-sb-priv.localdomain sb-rac1-priv
192.168.57.41 rac2-sb-priv.localdomain sb-rac2-priv
192.168.56.12 rac1-vip.localdomain rac1-vip
192.168.56.22 rac2-vip.localdomain rac2-vip
192.168.56.32 rac1-sb-vip.localdomain sb-rac1-vip
192.168.56.42 rac2-sb-vip.localdomain sb-rac2-vip

 

In the /etc/named.conf file I have the following: (Notice the highlighted areas as those are changed related to my configuration)

//
// named.conf
//
// Provided by Red Hat bind 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.
//
options {
listen-on port 53 { 192.168.56.51; };
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";
allow-query { any; };
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
zone "localdomain" IN {
type master;
file "localdomain.zone";
allow-transfer{ none; };
};
zone "56.168.192.in-addr.arpa" IN {
type master;
file "localdomain.reverse";
allow-transfer{ none; };
};

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

 

In the /etc/resolv.conf I had the following, this is where the client searches for the Name Server:

# Generated by NetworkManager
domain localdomain
nameserver 192.168.56.51

We now need to define our Names Server Zones, and this is done by editing adding the following files:

In the /var/named/localdomain.zone have the following:

;
$TTL 1D
@ IN SOA app1.localdomain. root (
42 ; serial#
3H ; refresh
15M ; retry
1W ; expire
1D) ; minumum
IN NS app1.localdomain.
rac1 IN A 192.168.56.11
rac2 IN A 192.168.56.21
sb-rac1 IN A 192.168.56.31
sb-rac2 IN A 192.168.56.41
app1 IN A 192.168.56.51
rac1-vip IN A 192.168.56.12
rac2-vip IN A 192.168.56.22
sb-rac1-vip IN A 192.168.56.32
sb-rac2-vip IN A 192.168.56.42
rac-scan IN A 192.168.56.61
rac-scan IN A 192.168.56.62
rac-scan IN A 192.168.56.63
rac-scan-sb IN A 192.168.56.71
rac-scan-sb IN A 192.168.56.72
rac-scan-sb IN A 192.168.56.73
 

Int the /var/names/localdomain.reverse have the following:

;
$TTL 1D
@ IN SOA app1.localdomain. root (
42 ; serial#
3H ; refresh
15M ; retry
1W ; expire
1D) ; minumum
IN NS app1.localdomain.
app1 IN A 192.168.56.51
11 IN PTR rac1.localdomain.
12 IN PTR rac1-vip.localdomain.
21 IN PTR rac2.localdomain.
22 IN PTR rac2-vip.localdomain.
31 IN PTR sb-rac1.localdomain.
32 IN PTR sb-rac1-vip.localdomain.
41 IN PTR sb-rac2.localdomain.
42 IN PTR sb-rac2-vip.localdomain.
51 IN PTR app1.localdomain.
61 IN PTR rac-scan.localdomain.
62 IN PTR rac-scan.localdomain.
63 IN PTR rac-scan.localdomain.
 

In the /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
NAME="Public Network"
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.56.51
NETMASK=255.255.255.0
GATEWAY=192.168.56.1
NM_CONTROLLED="no"
 

In the /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1
NAME="Private Network"
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.57.51
NETMASK=255.255.255.0
GATEWAY=192.168.57.1
NM_CONTROLLED="no"

 In the /etc/sysconfig/network-scripts/ifcfg-eth

DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback
NM_CONTROLLED="no"

You should now be able to restart your Name Server and then test that it works:

 run the following:

service named stop
service named start
nslookup rac-scan

The nslookup output should show the following to verify it is working:

Server: 192.168.56.51
Address: 192.168.56.51#53
Name: rac-scan.localdomain
Address: 192.168.56.62
Name: rac-scan.localdomain
Address: 192.168.56.63
Name: rac-scan.localdomain
Address: 192.168.56.61

 Congratulations, you should now have a working name server … in my case I do not access a dhcp server so my resolv.conf file will not change.

 

Leave a Reply