Sei sulla pagina 1di 33

1

Types of DNS Server

Master DNS Server

It is the Master Copy of all the Zone Information.


It is Read/Write copy.

Slave DNS Server

It is Slave Backup of Master zone. It is Read Only

2
How DNS works ?

client1 192.168.0.1
Forward client2 192.168.0.2
zoom.com
zone
sever 192.168.0.253
DNS
DNS DNS
DNSServer
Server
Fails
Fails
Server
Server
192.168.0.253 server
server
192.168.0.253
I
r cli P ad
fo m en d
t1. res
ess .co zo s
dr om IP om fo
ad .zo tio
n
19 add .co r
IP ent2 o lu 2.1 e r m
cli s 68 s s
re .0. is
NO 1

Linux
Linux Linux
Linux
Client
Client Client
Client
192.168.0.1
192.168.0.1 client1
client1 192.168.0.2
192.168.0.2 client2
client2

ZOOM.COM
ZOOM.COM

3
How DNS works ?

DNS
DNS
Server
Server
client1 192.168.0.1
192.168.0.253 server
server
Forward
192.168.0.253 zoom.com client2 192.168.0.2
zone
sever 192.168.0.253
Slave
Slave
DNS
DNS Server
Server

for 192.168.0.254 server2


server2
192.168.0.254
ess m
a d d r om.co
IP t2.zo
n
clie s i
s
Linux
Linux d dres 0.2
. Linux
Linux
Client IP a 2.168
Client 19 Client
Client
192.168.0.1
192.168.0.1 client1
client1 192.168.0.2
192.168.0.2 client2
client2

ZOOM.COM
ZOOM.COM

4
How Zone Transfer works ?

Master - Forward Zone


ZOOM.COM
Master
Master
DNS
DNS Server
SOA [42]
Server
Server
192.168.0.253
192.68.0.253
Client1 192.68.0.1
192.168.0.253 server
server
192.168.0.253
Client2 192.68.0.2

Slave - Forward Zone


Slave
Slave ZOOM.COM
DNS
DNS Server
Server
SOA [42] 192.168.0.253
Server 192.68.0.253
192.168.0.254 server2
server2
192.168.0.254
Client1 192.68.0.1
Client2 192.68.0.2

Linux
Linux Linux
Linux
Client
Client Client
Client
192.168.0.1
192.168.0.1 client1
client1 192.168.0.2
192.168.0.2 client2
client2

ZOOM.COM
ZOOM.COM

5
How SOA works ?

Master - Forward Zone


ZOOM.COM SO
Master
Master M AQ
y S uer
DNS
DNS Server
SOA [42]
Server
192.168.0.253 OA y
Server SOSOA is same
192.68.0.253 =4
Client1 192.68.0.1 ASOA
Qu is same 2
192.168.0.253
192.168.0.253 192.68.0.2No ery Transfer
My Zone
Client2
No SZone
OA ReTransfer
= 4 p ly
2 Slave - Forward Zone
server
server Slave
Slave ZOOM.COM 180
90
60
30
00
DNS
DNS Server
Server
SOA [42] 192.168.0.253
Server 192.68.0.253
192.168.0.254 server2
server2
192.168.0.254
Client1 192.68.0.1
Client2 192.68.0.2

Linux
Linux Linux
Linux
Client
Client Client
Client
192.168.0.1
192.168.0.1 client1
client1 192.168.0.2
192.168.0.2 client2
client2

ZOOM.COM
ZOOM.COM

6
How SOA works ?

Master - Forward Zone


ZOOM.COM SO
Master
Master M AQ
y S uer
DNS
DNS Server
SOA [42]
Server
[45] 192.168.0.253 OA y
Server SO is not
192.68.0.253 =4
Client1 SOAA
192.68.0.1 SOA Qu is notsame 2
same
192.168.0.253
192.168.0.253 192.68.0.2Do ery Transfer
My Zone
Client2
Server2
Do SZone
192.168.0.254 OA
R Transfer
epl
=4 y
5 Slave - Forward Zone
server
server Slave
Slave ZOOM.COM 180
90
60
30
00
DNS
DNS Server
Server
SOA [42] 192.168.0.253
Server 192.68.0.253
192.168.0.254 server2
server2
192.168.0.254
Client1 192.68.0.1
Client2 192.68.0.2

Linux
Linux Linux
Linux
Client
Client Client
Client
192.168.0.1
192.168.0.1 client1
client1 192.168.0.2
192.168.0.2 client2
client2

ZOOM.COM
ZOOM.COM

7
How SOA works ?

Req
ues
Master
Master ted
f
rec or Up
DNS
DNS Server
Server Rep ord dat
Zone
ly w Transfer s ed
Zone ith Transfer
192.168.0.253
192.168.0.253 Completed
U
reCompleted
cor pdate
ds d
Slave - Forward Zone
server
server Slave
Slave ZOOM.COM
DNS
DNS Server
Server
SOA [45] 192.168.0.253
Server 192.68.0.253
192.168.0.254 server2
server2
192.168.0.254
Client1 192.68.0.1
Client2 192.68.0.2
Server2 192.168.0.254

Linux
Linux Linux
Linux
Client
Client Client
Client
192.168.0.1
192.168.0.1 client1
client1 192.168.0.2
192.168.0.2 client2
client2

ZOOM.COM
ZOOM.COM

8
Master / Slave Configuration

Master
Master
DNS
DNS Server
Server
192.168.0.253 server
server
192.168.0.253

Slave
Slave
DNS
DNS Server
Server
192.168.0.254 server2
server2
192.168.0.254

Linux
Linux Linux
Linux
Client
Client Client
Client
192.168.0.1
192.168.0.1 client1
client1 192.168.0.2
192.168.0.2 client2
client2

ZOOM.COM
ZOOM.COM

9
Configuring DNS Server

Install
Installthe
thepackage
packageby
byusing
usingone
oneof
ofthe
theinstallation
installationmethods
methods
[root@comp1~]#
[root@comp1~]# mount 192.168.0.250:/var/ftp/pub/RedHat/RPMS/ /mnt
mount 192.168.0.250:/var/ftp/pub/RedHat/RPMS/ /mnt
[root@comp1
[root@comp1~]#
~]#cd cd /mnt
/mnt
[root@comp1
[root@comp1~]#
~]#rpm
rpm -ivh
-ivh bind*
bind* caching*
caching* --force
--force --aid
--aid

Open
Openconfiguration
configurationfor
forediting
editing
[root@comp1~]# vi /etc/named.conf
[root@comp1~]# vi /etc/named.conf

10
/etc/named.conf

To
Tochange
change the
theoptions
options
zone "zoom.com" IN
zone"zoom.com" IN{{
type
typemaster;
master;
file zoom.for";
file zoom.for";
};
};
zone
zone"0.168.192.in-addr.arpa"
"0.168.192.in-addr.arpa"IN
IN{{
type
typemaster;
master;
file zoom.rev";
file zoom.rev";
};
};

11
Configuring Forward Lookup

Copying
CopyingForward
Forwardlookup
lookupzone
zonefile
file
[root@comp1 ~]# cd /var/named/chroot/var/named/
[root@comp1 ~]# cd /var/named/chroot/var/named/
[root@comp1
[root@comp1named]#
named]# cp
cp localhost.zone
localhost.zone zoom.for
zoom.for

Open
Openconfiguration
configurationfor
for editing
editing
[root@comp1 named]# vi zoom.for
[root@comp1 named]# vi zoom.for

12
/var/named/chroot/var/named/zoom.for

To
Toadd
addthe
theoptions
options
$TTL
$TTL 86400
86400
@@ IN
IN SOA
SOA server.zoom.com.
server.zoom.com.root.zoom.com.(
root.zoom.com.(
42
42 ;; serial(d.
serial (d.adams)
adams)
3H
3H ;;refresh
refresh
15M
15M ;;retry
retry
1W
1W ;;expiry
expiry
1D
1D)) ;;minimum
minimum
IN
IN NS
NS server.zoom.com.
server.zoom.com.
server
server IN
IN AA 192.168.0.253
192.168.0.253
client1
client1 IN
IN AA 192.168.0.1
192.168.0.1
client2
client2 IN
IN AA 192.168.0.2
192.168.0.2
www
www IN
IN CNAME
CNAME server
server

13
Configuring Reverse Lookup

Copying
CopyingForward
Forwardlookup
lookupzone
zonefile
file
[root@comp1 ~]# cd /var/named/chroot/var/named/
[root@comp1 ~]# cd /var/named/chroot/var/named/
[root@comp1
[root@comp1named]#
named]# cp
cp named.local
named.local zoom.rev
zoom.rev

Open
Openconfiguration
configurationfor
for editing
editing
[root@comp1 named]# vi zoom.rev
[root@comp1 named]# vi zoom.rev

14
/var/named/chroot/var/named/zoom.rev

To
Toadd
addthe
theoptions
options
$TTL
$TTL 86400
86400
@@ IN
IN SOA
SOA server.zoom.com.
server.zoom.com.root.zoom.com.(
root.zoom.com.(
1997022700
1997022700 ;;Serial
Serial
28800
28800 ;;Refresh
Refresh
14400
14400 ;;Retry
Retry
3600000
3600000 ;;Expire
Expire
86400
86400)) ;;Minimum
Minimum
IN
IN NS
NS server.zoom.com.
server.zoom.com.
253
253 IN
IN PTR
PTR server.
server.
11 IN
IN PTR
PTR client1.
client1.
22 IN
IN PTR
PTR client2.
client2.

15
Configuring DNS Server IP address

Open
Openconfiguration
configurationfor
for editing
editing
[root@comp1 ~]# vi /etc/resolv.conf
[root@comp1 ~]# vi /etc/resolv.conf

Add
Addthe
theDNS
DNSserver
serverIP
IPaddress
addressin
infile
file/etc/resolv.conf
/etc/resolv.conf
nameserver 192.168.0.253
nameserver 192.168.0.253

16
DNS Server

To
Torestart
restartthe
theDNS
DNSservices
services
[root@comp1 ~]# service named restart
[root@comp1 ~]# service named restart

17
Checking from DNS Server

Checking
CheckingForward
ForwardLookup
Lookup
[root@comp1 ~]# dig server.zoom.com
[root@comp1 ~]# dig server.zoom.com
[root@comp1
[root@comp1~]#
~]#dig
dig client1.zoom.com
client1.zoom.com

Checking
Checking Reverse
ReverseLookup
Lookup
[root@comp1
[root@comp1~]#
~]# dig
dig xx 192.168.0.253
192.168.0.253
[root@comp1
[root@comp1~]#
~]# dig
dig xx 192.168.0.1
192.168.0.1

Checking
CheckingName
Nameresolution
resolution
[root@comp1 ~]# ping server.zoom.com
[root@comp1 ~]# ping server.zoom.com
[root@comp1
[root@comp1~]#
~]#ping
ping client2.zoom.com
client2.zoom.com

18
Debug DNS File

To
Tocheck
checkmain
mainconfiguration
configurationfile
filesyntax
syntax
[root@comp1 ~]# named-checkconf /etc/named.conf
[root@comp1 ~]# named-checkconf /etc/named.conf

To
Tocheck
checkforward
forwardzone
zonefile
filesyntax
syntax
[root@comp1
[root@comp1~]#
~]#named-checkzone
named-checkzonezoom.com
zoom.com /var/named
/var/named
/chroot/var/named/zoom.for
/chroot/var/named/zoom.for

To
Tocheck
checkreverse
reversezone
zonefile
filesyntax
syntax
[root@comp1
[root@comp1 ~]# named-checkzone zoom.com /var/named
~]# named-checkzone zoom.com /var/named
/chroot/var/named/zoom.rev
/chroot/var/named/zoom.rev

19
Configuring DNS Client

Open
Openconfiguration
configurationfor
for editing
editing
[root@comp1 ~]# vi /etc/resolv.conf
[root@comp1 ~]# vi /etc/resolv.conf

Add
Addthe
theDNS
DNSserver
serverIP
IPaddress
addressin
infile
file/etc/resolv.conf
/etc/resolv.conf
nameserver 192.168.0.253
nameserver 192.168.0.253
nameserver
nameserver 192.168.0.254
192.168.0.254

20
Checking from DNS Client

Dig
Dig another
anotherPC
PCvia
viaFQDN
FQDN
[root@comp1 ~]# dig server.zoom.com
[root@comp1 ~]# dig server.zoom.com
[root@comp1
[root@comp1~]#
~]#dig
dig client2.zoom.com
client2.zoom.com

Dig
DigDNS
DNSserver
serverIP
IP
[root@comp1
[root@comp1~]#
~]# dig
dig xx 192.168.0.253
192.168.0.253

Ping
Pinganother
anotherPC
PCvia
viaFQDN
FQDN
[root@comp1 ~]# ping server.zoom.com
[root@comp1 ~]# ping server.zoom.com
[root@comp1
[root@comp1~]#
~]#ping
ping client2.zoom.com
client2.zoom.com

21
SLAVE DNS SERVER

Configuring DNS Server

Install
Installthe
thepackage
packageby
byusing
usingone
oneof
ofthe
theinstallation
installationmethods
methods
[root@comp1~]#
[root@comp1~]# mount 192.168.0.250:/var/ftp/pub/RedHat/RPMS/ /mnt
mount 192.168.0.250:/var/ftp/pub/RedHat/RPMS/ /mnt
[root@comp1
[root@comp1~]#
~]#cd cd /mnt
/mnt
[root@comp1
[root@comp1~]#
~]#rpm
rpm -ivh
-ivh bind*
bind* caching*
caching* --force
--force --aid
--aid

Open
Openconfiguration
configurationfor
forediting
editing
[root@comp1~]# vi /etc/named.conf
[root@comp1~]# vi /etc/named.conf

22
/etc/named.conf

To
Tochange
changethe
theoptions
options
zone "zoom.com" IN {
zone "zoom.com" IN {
type
typeslave;
slave;
file
file"slaves/zoom.for";
"slaves/zoom.for";
masters
masters{{192.168.0.253;
192.168.0.253;};
};
};
};
zone
zone"0.168.192.in-addr.arpa"
"0.168.192.in-addr.arpa"IN
IN{{
type
typeslave;
slave;
file
file"slaves/zoom.rev";
"slaves/zoom.rev";
masters
masters{{192.168.0.253;
192.168.0.253;};
};
};
};

23
Configuring DNS Server IP address

Open
Openconfiguration
configurationfor
for editing
editing
[root@comp1 ~]# vi /etc/resolv.conf
[root@comp1 ~]# vi /etc/resolv.conf

Add
Addthe
theDNS
DNSserver
serverIP
IPaddress
addressin
infile
file/etc/resolv.conf
/etc/resolv.conf
nameserver 192.168.0.254
nameserver 192.168.0.254

24
DNS Server

To
Torestart
restartthe
theDNS
DNSservices
services
[root@comp1 ~]# service named restart
[root@comp1 ~]# service named restart

25
Types of DNS Server

Forwarder
Forwards requests to a specific list of DNS servers
for name resolution. If none of the specified DNS
servers can perform the resolution, the resolution
fails.

26
How Forwarders works ?

DNS client1 192.168.0.1


DNS
Forward
Server
zone
ServerNo client2
NoResolution
zoom.com
Resolution
192.168.0.2

sever 192.168.0.253
192.168.0.253
192.168.0.253
r
fo m cl IP a ISP
ISP DNS
DNS
ien dd
ik ng o.co t1 res
o .zo s 61.0.0.5
61.0.0.5
lo aho IP om fo
y
I m ww. 19 d
ad .co r
w 2.1 res m
68 s
.0. is
Linux
Linux 1
Client
Client Linux
Linux
Client
Client
192.168.0.1
192.168.0.1 yahoo.com
yahoo.com
192.168.0.2
192.168.0.2
210.10.152.15
210.10.152.15

27
How Forwarders works ?

m looking for
DNS
DNS Add Forwarder www.yahoo.com
Add Forwarder
Server
Server IP
IPaddress
address
61.0.0.5 Here s address of
61.0.0.5
192.168.0.253
192.168.0.253 www.yahoo.com address
210.10.152.15
r
fo m cl IP a ISP
ISP DNS
DNS
ien dd
ing .co t1 res
ook hoo s of .zo s 61.0.0.5
61.0.0.5
l a s m IP om fo
m .y re co a .co r
I ww
add oo. .15 19 ddr m
w s a h 52 2.1 es
e re w.y 0.1 68 s
i
H w 0. 1 .0.1 s
Linux
Linux w 21
Client
Client Linux
Linux
Client
Client
192.168.0.1
192.168.0.1 yahoo.com
yahoo.com
192.168.0.2
192.168.0.2
210.10.152.15
210.10.152.15

28
Forwarder Configuration

DNS
DNS
Server
Server
192.168.0.253
192.168.0.253
ISP
ISP DNS
DNS
61.0.0.5
61.0.0.5

Linux
Linux
Client
Client Linux
Linux
Client
Client
192.168.0.1
192.168.0.1 yahoo.com
yahoo.com
192.168.0.2
192.168.0.2
210.10.152.15
210.10.152.15

29
Configuring Forwarder

Open
Openconfiguration
configurationfor
forediting
editing
[root@comp1~]# vi /etc/named.conf
[root@comp1~]# vi /etc/named.conf

Add
Addthe
thebelow
belowline
linein
in/etc/named.conf
/etc/named.conf
forwarders { 61.0.0.5;};
forwarders { 61.0.0.5;};

30
DNS Server

To
Torestart
restartthe
theDNS
DNSservices
services
[root@comp1 ~]# service named restart
[root@comp1 ~]# service named restart

31
Configuring DNS Client

Open
Openconfiguration
configurationfor
for editing
editing
[root@comp1 ~]# vi /etc/resolv.conf
[root@comp1 ~]# vi /etc/resolv.conf

Add
Addthe
theDNS
DNSserver
serverIP
IPaddress
addressin
infile
file/etc/resolv.conf
/etc/resolv.conf
nameserver 192.168.0.253
nameserver 192.168.0.253

32
Checking from DNS Client

Check
Checkby
by dig
digcommand
command
[root@comp1 ~]# dig www.yahoo.com
[root@comp1 ~]# dig www.yahoo.com

Check
Checkby
by ping
pingcommand
command
[root@comp1
[root@comp1~]#
~]#ping
ping www.yahoo.com
www.yahoo.com

33

Potrebbero piacerti anche