0% found this document useful (0 votes)
0 views

RAC-DNS-and-DHCP-Server-setup

Uploaded by

anghaprapul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

RAC-DNS-and-DHCP-Server-setup

Uploaded by

anghaprapul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 59

How to create a DNS server for Oracle 12c RAC installation using Grid Naming Service (GNS)

Install dhcp package via YUM

[root@dns01 ~]# yum install dhcp -y


Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
public_ol6_UEKR4 | 1.2 kB 00:00
public_ol6_UEKR4/primary | 19 MB 01:47
public_ol6_UEKR4 423/423
public_ol6_latest | 1.4 kB 00:00
public_ol6_latest/primary | 65 MB 08:20
public_ol6_latest 39383/39383
Resolving Dependencies
--> Running transaction check
---> Package dhcp.x86_64 12:4.1.1-53.P1.0.1.el6_9.1 will be installed
--> Processing Dependency: dhcp-common = 12:4.1.1-53.P1.0.1.el6_9.1 for package: 12:dhcp-4.1.1-53.P1.0.1.el6_9.1.x86_64
--> Running transaction check
---> Package dhcp-common.x86_64 12:4.1.1-51.P1.0.1.el6 will be updated
--> Processing Dependency: dhcp-common = 12:4.1.1-51.P1.0.1.el6 for package: 12:dhclient-4.1.1-51.P1.0.1.el6.x86_64
---> Package dhcp-common.x86_64 12:4.1.1-53.P1.0.1.el6_9.1 will be an update
--> Running transaction check
---> Package dhclient.x86_64 12:4.1.1-51.P1.0.1.el6 will be updated
---> Package dhclient.x86_64 12:4.1.1-53.P1.0.1.el6_9.1 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================
Installing:
dhcp x86_64 12:4.1.1-53.P1.0.1.el6_9.1 public_ol6_latest 823 k
Updating for dependencies:
dhclient x86_64 12:4.1.1-53.P1.0.1.el6_9.1 public_ol6_latest 321 k
dhcp-common x86_64 12:4.1.1-53.P1.0.1.el6_9.1 public_ol6_latest 144 k

Transaction Summary
===================================================================================================================================
Install 1 Package(s)
Upgrade 2 Package(s)

Total download size: 1.3 M


Downloading Packages:
(1/3): dhclient-4.1.1-53.P1.0.1.el6_9.1.x86_64.rpm | 321 kB 00:01
(2/3): dhcp-4.1.1-53.P1.0.1.el6_9.1.x86_64.rpm | 823 kB 00:07
(3/3): dhcp-common-4.1.1-53.P1.0.1.el6_9.1.x86_64.rpm | 144 kB 00:01
-----------------------------------------------------------------------------------------------------------------------------------
Total 109 kB/s | 1.3 MB 00:11
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Importing GPG key 0xEC551F03:
Userid : Oracle OSS group (Open Source Software group) <[email protected]>
Package: 6:oraclelinux-release-6Server-8.0.3.x86_64 (@anaconda-OracleLinuxServer-201605181719.x86_64/6.8)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : 12:dhcp-common-4.1.1-53.P1.0.1.el6_9.1.x86_64 1/5
Installing : 12:dhcp-4.1.1-53.P1.0.1.el6_9.1.x86_64 2/5
Updating : 12:dhclient-4.1.1-53.P1.0.1.el6_9.1.x86_64 3/5
Cleanup : 12:dhclient-4.1.1-51.P1.0.1.el6.x86_64 4/5
Cleanup : 12:dhcp-common-4.1.1-51.P1.0.1.el6.x86_64 5/5
Verifying : 12:dhcp-common-4.1.1-53.P1.0.1.el6_9.1.x86_64 1/5
Verifying : 12:dhcp-4.1.1-53.P1.0.1.el6_9.1.x86_64 2/5
Verifying : 12:dhclient-4.1.1-53.P1.0.1.el6_9.1.x86_64 3/5
Verifying : 12:dhcp-common-4.1.1-51.P1.0.1.el6.x86_64 4/5
Verifying : 12:dhclient-4.1.1-51.P1.0.1.el6.x86_64 5/5
Installed:
dhcp.x86_64 12:4.1.1-53.P1.0.1.el6_9.1

Dependency Updated:
dhclient.x86_64 12:4.1.1-53.P1.0.1.el6_9.1 dhcp-common.x86_64 12:4.1.1-53.P1.0.1.el6_9.1

Complete!
[root@dns01 ~]#

Edit /etc/dhcp/dhcpd.conf

ddns-update-style interim;
ignore client-updates;

subnet 192.168.56.0 netmask 255.255.255.0 {

option routers 192.168.56.1; # Default gateway to be used by DHCP clients


option subnet-mask 255.255.255.0; # Default subnet mask to be used by DHCP clients.
option ip-forwarding off; # Do not forward DHCP requests.
option broadcast-address 192.168.56.255; # Default broadcast address to be used by DHCP client.

option domain-name "rac.localdomain";


option domain-name-servers 192.168.56.102; # IP address of the DNS server. In this document it will be dns

range 192.168.56.2 192.168.56.254; # Range of IP addresses that can be issued to DHCP client

default-lease-time 21600; # Amount of time in seconds that a client may keep the IP address
max-lease-time 43200;
}

Start dhcp daemon process

[root@dns01 ~]# touch /var/lib/dhcpd/dhcpd.leases

[root@dns01 ~]# service dhcpd start


Starting dhcpd: [ OK ]

[root@dns01 ~]# chkconfig dhcpd on


[root@dns01 ~]# service dhcpd status
dhcpd (pid 3251) is running...

Install bind related packages


[root@dns01 ~]# yum install bind-libs bind bind-utils -y
Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package bind.x86_64 32:9.8.2-0.62.rc1.el6_9.4 will be installed
---> Package bind-libs.x86_64 32:9.8.2-0.47.rc1.el6 will be updated
---> Package bind-libs.x86_64 32:9.8.2-0.62.rc1.el6_9.4 will be an update
---> Package bind-utils.x86_64 32:9.8.2-0.47.rc1.el6 will be updated
---> Package bind-utils.x86_64 32:9.8.2-0.62.rc1.el6_9.4 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================
Installing:
bind x86_64 32:9.8.2-0.62.rc1.el6_9.4 public_ol6_latest 4.0 M
Updating:
bind-libs x86_64 32:9.8.2-0.62.rc1.el6_9.4 public_ol6_latest 891 k
bind-utils x86_64 32:9.8.2-0.62.rc1.el6_9.4 public_ol6_latest 188 k

Transaction Summary
===================================================================================================================================
Install 1 Package(s)
Upgrade 2 Package(s)

Total download size: 5.1 M


Downloading Packages:
(1/3): bind-9.8.2-0.62.rc1.el6_9.4.x86_64.rpm | 4.0 MB 00:19
(2/3): bind-libs-9.8.2-0.62.rc1.el6_9.4.x86_64.rpm | 891 kB 00:04
(3/3): bind-utils-9.8.2-0.62.rc1.el6_9.4.x86_64.rpm | 188 kB 00:00
-----------------------------------------------------------------------------------------------------------------------------------
Total 202 kB/s | 5.1 MB 00:25
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : 32:bind-libs-9.8.2-0.62.rc1.el6_9.4.x86_64 1/5
Installing : 32:bind-9.8.2-0.62.rc1.el6_9.4.x86_64 2/5
Updating : 32:bind-utils-9.8.2-0.62.rc1.el6_9.4.x86_64 3/5
Cleanup : 32:bind-utils-9.8.2-0.47.rc1.el6.x86_64 4/5
Cleanup : 32:bind-libs-9.8.2-0.47.rc1.el6.x86_64 5/5
Verifying : 32:bind-libs-9.8.2-0.62.rc1.el6_9.4.x86_64 1/5
Verifying : 32:bind-9.8.2-0.62.rc1.el6_9.4.x86_64 2/5
Verifying : 32:bind-utils-9.8.2-0.62.rc1.el6_9.4.x86_64 3/5
Verifying : 32:bind-libs-9.8.2-0.47.rc1.el6.x86_64 4/5
Verifying : 32:bind-utils-9.8.2-0.47.rc1.el6.x86_64 5/5

Installed:
bind.x86_64 32:9.8.2-0.62.rc1.el6_9.4

Updated:
bind-libs.x86_64 32:9.8.2-0.62.rc1.el6_9.4 bind-utils.x86_64 32:9.8.2-0.62.rc1.el6_9.4

Complete!
[root@dns ~]#

Edit named.conf file


[root@dns01 ~]# vi /etc/named.conf

options {

directory "/var/named"; // Base directory for named


allow-transfer {"none";}; // Slave serves that can pull zone transfer. Ban everyone by default

};

zone "56.168.192.IN-ADDR.ARPA." IN { // Reverse zone.


type master;
notify no;
file "192.168.56.db";
};

zone "localdomain." IN {
type master;
notify no;
file "localdomain.db";
};

zone "." in {
type hint;
file "/dev/null";
};
Edit zone files
[root@dns01 ~]# cd /var/named

[root@dns01 named]# vi localdomain.db

$TTL 1H ; Time to live


$ORIGIN localdomain.
@ IN SOA dns01 root.localdomain. (
2018060701 ; serial (todays date + todays serial #)
3H ; refresh 3 hours
1H ; retry 1 hour
1W ; expire 1 week
1D ) ; minimum 24 hour
;
A 192.168.56.102
NS dns01 ; name server for localdomain
dns01 A 192.168.56.102
rac01 A 192.168.56.100
rac02 A 192.168.56.101
rac-gns A 192.168.56.150 ; A record for the GNS
;
;sub-domain(rac.localdomain) definitions
$ORIGIN rac.localdomain.
@ IN NS rac-gns.localdomain. ;

[root@dns01 named]# vi 192.168.56.db

$TTL 1H
@ IN SOA dns01 root.localdomain. (
2018060701 ; serial (todays date + todays serial #)
3H ; refresh 3 hours
1H ; retry 1 hour
1W ; expire 1 week
1D ) ; minimum 24 hour
;
NS dns01.localdomain.
100 PTR rac01.localdomain.
101 PTR rac02.localdomain.
102 PTR dns01.localdomain.
150 PTR rac-gns.localdomain. ; reverse mapping for GNS

Start name server


[root@dns01 named]# service named start
Generating /etc/rndc.key: [ OK ]
Starting named: [ OK ]

[root@dns01 named]# service named status


version: 9.8.2rc1-RedHat-9.8.2-0.62.rc1.el6_9.4
CPUs found: 1
worker threads: 1
number of zones: 18
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
recursive clients: 0/0/1000
tcp clients: 0/100
server is up and running
named (pid 3410) is running...

[root@dns01 named]# chkconfig named on

Edit resolv.conf file


[root@dns01 named]# vi /etc/resolv.conf

# Generated by NetworkManager
search localdomain rac.localdomain

nameserver 192.168.56.102

[root@dns01 named]# chattr +i /etc/resolv.conf

Check DNS
[root@dns01 named]# dig rac-gns.localdomain

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.62.rc1.el6_9.4 <<>> rac-gns.localdomain


;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30006
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;rac-gns.localdomain. IN A

;; ANSWER SECTION:
rac-gns.localdomain. 3600 IN A 192.168.56.150

;; AUTHORITY SECTION:
localdomain. 3600 IN NS dns01.localdomain.

;; ADDITIONAL SECTION:
dns.localdomain. 3600 IN A 192.168.56.102

;; Query time: 1 msec


;; SERVER: 192.168.56.102#53(192.168.56.102)
;; WHEN: Fri Jul 13 13:44:11 2018
;; MSG SIZE rcvd: 87

[root@dns01 named]# nslookup dns01


Server: 192.168.56.102
Address: 192.168.56.102#53

Name: dns01.localdomain
Address: 192.168.56.102

[root@dns named]# nslookup rac-gns


Server: 192.168.56.102
Address: 192.168.56.102#53

Name: rac-gns.localdomain
Address: 192.168.56.150

Disable Firewall
[root@dns named]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]

[root@dns named]# chkconfig iptables off

You might also like