Chapter 5
Creating Zones- Forward & Reverse
1. Main file configuration - /etc/named.conf
options {
listen-on port 53 { any; };
directory
"/var/named";
allow-query
{ any; };
recursion yes;
2.
Creating forward and reverse zones – chul.com
# vi
/etc/named.rfc1912.zones
a.
Forward zone for chul.com
zone
"chul.com" IN {
type master;
file "chul.zone";
allow-update { none; };
b.
Reverse zone for chul.com
zone "80.168.192.in-addr.arpa"
IN {
type master;
file "80.zone";
allow-update { none; };
};
3.
Database file for chul.com
a.
Forward zone file
# cat
/var/named/chroot/var/named/chul.zone
$TTL 1D
@ IN SOA @
root.chul.com. (
2013062501 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H
) ; minimum
NS ns.chul.com.
MX 5 ms1.chul.com.
MX 10 ms2.chul.com.
ns A 192.168.80.5
www A 192.168.80.5
ms1 A 192.168.80.5
ms2 A
192.168.80.6
ftp A
192.168.80.5
# chown
root.named chul.zone
b.
Reverse zone file
# cat
/var/named/chroot/var/named/80.zone
$TTL 1D
@
IN SOA ns.chul.com. root.chul.com. (
2013070101 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H
) ; minimum
@ NS
ns.chul.com.
@ NS
ns2.chul.com.
5
IN PTR
ns.chul.com.
6 IN
PTR ns2.chul.com.
5 IN
PTR www.chul.com.
5
IN PTR
ftp.chul.com.
# chown
root.named 80.zone
4. Zone
testing
# cat
/etc/resolv.conf
nameserver 192.168.80.5
#
service named restart
# tail
–f /var/log/messages
# host
–a chul.com
Chapter 6
Adding More Zone
1.
Adding New zone – jeong.com
# vi
/etc/named.rfc1912.zones
zone “jeong.com"
IN {
type master;
file “jeong.zone";
allow-update { none; };
2.Database
file for new zone
# cp
/var/namedchroot/var/named/chul.zone /var/named/chroot/var/named/jeong.zone
# vi
/var/named/chroot/var/named/jeong.zone
$TTL 1D
@
IN SOA ns.chul.com. root.chul.com. (
20130401 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H
) ; minimum
@ NS
ns.chul.com.
@ MX
5 ms1.chul.com.
@ MX
10 ms2.chul.com.
ns IN
A 192.168.80.5
ns2 IN
A 192.168.80.6
www IN
A 192.168.80.6
ms1 IN
A 192.168.80.5
ms2 IN
A 192.168.80.6
ftp IN
A 192.168.80.5
3.Testing
New Zone
# chown
root.named
/var/named/chroot/var/named/jeong.zone
#
service named restart
# host
–a jeong.com
4.
Syntax checking using named-checkconf and named-checkzone
#named-checkconf
/etc/named.conf
#named-checkzone
chul.com chul.zone
Chapter 7 Round-Robin Load Sharing
1.Update database file (/var/named/chul.zone)
www IN A 192.168.80.5
www IN A 192.168.80.6
www IN A 192.168.80.7
# service named restart
2.Testing
# ping –c3 www.chul.com
# ping –c3 www.chul.com
# ping –c3 www.chul.com
3.CNAME
ftp IN CNAME www
Chapter 8 Master and Slave Nameserver
1.Mater server – server.chul.com
# cat /etc/named.rfc1912.zones
zone “chul.com" IN {
type
master;
file
“chul.zone";
allow-update { none; };
allow-transfer { 192.168.80.6; };
# service named restart
2.Slave server – client.chul.com
# cat /etc/named.rfc1912.zones
zone “chul.com" IN {
type slave;
file
"slaves/chul.zone";
masters { 192.168.80.5; };
allow-update { none; };
# service named restart
3.Testing Master and Slave server
a. On slave server
# cat /etc/resolv.conf
nameserver 192.168.80.5
nameserver 192.168.80.6
# dig @server.chul.com
chul.com ns
# ls –l /var/named/chroot/var/named/slaves
b. Shutdown master server
# service named stop
c. Query domain chul.com to Slave server
# host –a chul.com
# dig @client.chul.com chul.com ns
Thank you very much !!!
ReplyDelete