Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 8

DNS Configuration

IN Oracle VM DNS is inherent form HOST dns, so disable the DHCP of


HOST_ONLY_ADAPTER then gest can use local DNS updated in "/etc/resolve.conf"

# yum install bind-libs bind bind-utils

If you want a GUI DNS editor, you can also install the following package.
Personally, I find the GUI editor more confusing than using the configuration files
directly.

# yum install system-config-bind


===================================================================================
=======
"/etc/named.conf" File content

//
// 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 { 127.0.0.1; 192.168.56.3; }; ## master dns
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";
allow-query { any; }; ##IP Range
allow-recursion {
localhost;
};

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"sam.com" IN {
type master;
file "sam.com";
allow-update { none; };
};
zone "56.168.192.in-addr.arpa" IN {
type master;
file "56.168.192.in-addr.arpa";
allow-update { none; };
};

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

===================================================================================
================

add reverse lookup zone in file named.rfc1912.zones --> Note dont add forwar zone
"sam.com"

vi /etc/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
// and http://www.ietf.org/internet-drafts/draft-ietf-dnsop-default-local-zones-
02.txt
// (c)2007 R W Franks
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

zone "localhost.localdomain" IN {
type master;
file "named.localhost";
allow-update { none; };
};

zone "localhost" IN {
type master;
file "named.localhost";
allow-update { none; };
};

zone "1.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.loopback";
allow-update { none; };
};

zone "1.0.0.127.in-addr.arpa" IN {
type master;
file "named.loopback";
allow-update { none; };
};
zone "0.in-addr.arpa" IN {
type master;
file "named.empty";
allow-update { none; };
};

zone "56.168.192.in-addr.arpa" IN {
type master;
file "56.168.192.in-addr.arpa";
allow-update { none; };
};

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
to check named file is correct or not

named-checkconf /etc/named.conf

===================================================================================
=====

files and permission in /var/named/ (check permission also)

[root@dns named]# ls -ltr /var/named/


total 52
-rw-r----- 1 root named 152 Jun 21 2007 named.localhost
-rw-r----- 1 root named 168 Dec 15 2009 named.loopback
-rw-r----- 1 root named 152 Dec 15 2009 named.empty
-rw-r----- 1 root named 2075 Apr 23 2014 named.ca
drwxrwx--- 2 named named 4096 May 11 2015 slaves
drwxr-x--- 6 root named 4096 Mar 17 17:01 chroot
-rw-r----- 1 root named 1616 Mar 25 02:58 sam.com
drwxrwx--- 2 named named 4096 Mar 25 03:25 data
-rw-r----- 1 root named 915 Mar 25 03:39 56.168.192.in-addr.arpa
drwxrwx--- 2 named named 4096 Mar 25 03:45 dynamic

===================================================================================
================
cd /var/named/

content forward zone "sam.com"

$TTL 1D
@ IN SOA dns.sam.com root.dns.sam.com (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS dns
dns IN A 192.168.56.3
rac1-priv IN A 192.168.10.101
rac2-priv IN A 192.168.10.102
rac3-priv IN A 192.168.10.103
racdg1-priv IN A 192.168.10.104
racdg2-priv IN A 192.168.10.105
rac12c1-priv IN A 192.168.10.106
rac12c2-priv IN A 192.168.10.107
rac1 IN A 192.168.56.110
rac2 IN A 192.168.56.111
rac3 IN A 192.168.56.112
racdg1 IN A 192.168.56.113
racdg2 IN A 192.168.56.114
rac12c1 IN A 192.168.56.116
rac12c2 IN A 192.168.56.117
rac1-vip IN A 192.168.56.120
rac2-vip IN A 192.168.56.121
rac3-vip IN A 192.168.56.122
racdg1-vip IN A 192.168.56.123
racdg2-vip IN A 192.168.56.124
rac12c1-vip IN A 192.168.56.125
rac12c2-vip IN A 192.168.56.126
rac-scan IN A 192.168.56.130
rac-scan IN A 192.168.56.131
rac-scan IN A 192.168.56.132
rac-12 IN A 192.168.56.133
rac-12 IN A 192.168.56.134
rac-12 IN A 192.168.56.135
dg11g IN A 192.168.56.10
dg2 IN A 192.168.56.11
dg3 IN A 192.168.56.12
db11g IN A 192.168.56.13
db12c IN A 192.168.56.14
sam IN A 192.168.56.201

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
to check zone configuration is correct or not

named-checkzone sam.com /var/named/sam.com

===================================================================================
==================

content of reverse zone "56.168.192.in-addr.arpa"

$ORIGIN 56.168.192.in-addr.arpa.
$TTL 1D
@ IN SOA sam.com. root.sam.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS dns.sam.com.
3 IN PTR dns.sam.com.
110 IN PTR rac1.sam.com.
111 IN PTR rac2.sam.com.
112 IN PTR rac3.sam.com.
113 IN PTR racdg1.sam.com.
114 IN PTR racdg2.sam.com.
120 IN PTR rac1-vip.sam.com.
121 IN PTR rac2-vip.sam.com.
122 IN PTR rac3-vip.sam.com.
123 IN PTR racdg1-vip.sam.com.
124 IN PTR racdg2-vip.sam.com.
130 IN PTR rac-scan.sam.com.
131 IN PTR rac-scan.sam.com.
132 IN PTR rac-scan.sam.com.
123 IN PTR racdg1-vip.sam.com.
124 IN PTR racdg2-vip.sam.com.

===================================================================================
=========================
add one more reverse zone fro different network (private IP of RAC)

[root@dns named]# cat 10.168.192.in-addr.arpa


$ORIGIN 10.168.192.in-addr.arpa.
$TTL 1D
@ IN SOA sam.com. root.sam.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS dns.sam.com.
3 IN PTR dns.sam.com.
101 IN PTR rac1-priv.sam.com.
102 IN PTR rac2-priv.sam.com.
103 IN PTR rac3-priv.sam.com.
104 IN PTR racdg1-priv.sam.com.
105 IN PTR racdg2-priv.sam.com.

[root@dns named]# rndc reconfig

service named restart

chkconfig named on

===================================================================================
=====
Now in each client of same domain "sam.com"

"/etc/resolv.conf" File
The DNS server is now running, but each server must be told to use it. This is done
by editing the "/etc/resolv.conf" file on each server,
including the RAC nodes. Make sure the file contains the following entries, where
the IP address and domain match those of your DNS server and the domain you have
configured.

cat >> /etc/resolv.conf <<EOF


nameserver 192.168.56.3
search sam.com hello.com #
EOF

Note --> upto 6 domain u can add

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Prevent /sbin/dhclient to update resolv.conf

chattr +i /etc/resolv.conf

to revert back

chattr -i /etc/resolv.conf
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
add DNS in eth0 file
DNS1=192.168.56.3

===================================================================================
=====================

Configure NTP server

Am using my dns server as NTP server

vi /etc/ntp.conf

server dns.sam.com iburst

service ntpd start


chkconfig ntpd on

Then update same file in all client with same content.

ntpq -pn

ntptime

Modified below file content:


vi /etc/sysconfig/ntpd
OPTIONS=�-x -u ntp:ntp -p /var/run/ntpd.pid -g�

===================================================================================
=======================
YUM FTP server config

server is 192.168.56.3

mkdir -p /var/ftp/pub/rhel6/

cd /var/ftp/pub/rhel6/

copy image of rhel6 to lolcal machine

mount it

mkdir /oracle

mount -o loop >image_name> /oracle

cp -rv /oracle/Packages/* /var/ftp/pub/rhel6/

ls -ltr |wc -l

vi /etc/yum.repos.d/rhel6.repo

[rhel6_yum]
name=yum_rep
baseurl=file:///var/ftp/pub/rhel6
gpgcheck=0
Install below packagelist

cd /var/ftp/pub/rhel6

instal package vsftpd and createrepo and deltaparm and python-delta

rpm -ivh deltarpm


rpm -ivh python-delta
rpm -ivh createrepo
rpm -ivh vsftpd

yum clean all --> to clean list

yum list all --> to make new list

createrepo -v /var/ftp/pub/rhel6

chkconfig vsftpd on --> to make service avaialbe after reboot

systemctl list-unit-files --type=service

systemctl enable vsftpd

root@db_upgr /]# systemctl enable vsftpd.service

[root@db_upgr oracle]# systemctl status vsftpd

yum install package* -y --> will install package with dependency

#Note if yum failed with error "warning :rpmth_hdrfromFdno: Header V3 DSA


signatute"
then run yum with below option

yum --nogpgcheck install package_nameinit

#Note if guest addition not able to install because of KERNAL issue


Insatll kernel* and gcc* package through yum

yum clean all


----------------------------------------------------------------------
to update the repository with new rpm files.

[root@dns rhel7]# createrepo --update /var/ftp/pub/rhel6/

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Steps on Client

cat >> /etc/yum.repos.d/rhel6.repo <<EOF


[rhel6_yum]
name=yum_rep
baseurl=ftp://192.168.56.3/pub/rhel6
gpgcheck=0
EOF

cat >> /etc/yum.repos.d/rhel7.repo <<EOF


[rhel7_yum]
name=yum_rep7
baseurl=ftp://192.168.56.3/pub/rhel7
gpgcheck=0
EOF

cat >> /etc/yum.repos.d/rhel6.5.repo <<EOF


[rhel6.5_yum]
name=yum_rep
baseurl=ftp://192.168.56.3/pub/oracle6.5
gpgcheck=0
EOF

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Install a Package from Specific Repository
yum --enablerepo=epel install phpmyadmin

clean yum cache in client or server


path of cache /var/cache/yum
yum clean all --- clean cache

service vsftpd restart

yum list all |grep rlwrap --> to check rpm

---------------------------------------------
to clear cache and install package on client

yum clean all

yum install -y <package>

[root@dns rhel7]# yum whatprovides '*bin/unzip' --> to check which package provide
that command..
------------------------------------------------------------

You might also like