CPT 04 Dns

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

DNS

Concepts

DNS is a name resolution method , resolve name to IP Address

It’s a platform independent TCP service

It use TCP and UDP port 53


DNS
Concepts DNS database

DNS has a database , which keeps name to IP Address mappings

In internet DNS database consist of name to IP Address mappings of


entire websites and Mail Servers

This database has been divided hierarchically because its very bulk

com , net, edu, gov etc. are examples of first level divisions

For getting internet identity each and every organization should have a
domain name registration. Domain name registration means create a
sub session under a specific first level division
DNS
DNS database structure

Top level divisions Un named Root “ . ”

Second level divisions


DNS
Zone

Zone is a portion of DNS hierarchical database

Zone data is keeping on zone file

Examples…

Microsoft.com

Abc.com
DNS
Zone

There are two types of zones

⮚ Forward Lookup Zones Keep name to IP Address mappings

⮚ Reverse Lookup Zones Keep IP Address to name mappings

Reverse Lookup Zone has only one top level division in-addr.arpa
DNS
Zone

Forward and Reverse Lookup Zones again categorized in to

⮚ Primary (Master) (RW)

⮚ Secondary (Slave) (RO)

⮚ Stub

⮚ AD Integrated
DNS
How Primary and Secondary works …

DNS (S1) Master


S1 Abc.com
HO S1
c1 c2 c1
c2
S2
c3
c4

S2 DNS (S2) Slave

BR Abc.com
c3 c4
DNS
Zone Transfer

Zone Transfer updates database of secondary from


primary

⮚ AXFR All file zone transfer


⮚ IXFR Incremental zone transfer

Zone transfer is based on

⮚ Refresh time

⮚ Notification from primary

⮚ Manually
DNS
DNS Records

A Name to IPV4
Host /Address
AAAA Name to IPV6
Host /Address
DNS
DNS Records

A Name to IPV4
Host /Address
AAAA Name to IPV6
Host /Address
CNAME Point to another record Alias
DNS
DNS Records

A Name to IPV4
Host /Address
AAAA Name to IPV6
Host /Address
CNAME Point to another record Alias
PTR IP to Name
Pointer
DNS
DNS Records

A Name to IPV4
Host /Address
AAAA Name to IPV6
Host /Address
CNAME Point to another record Alias
PTR IP to Name
Pointer
MX Mail Server of a domain
Mail Exchanger
DNS
DNS Records

A Name to IPV4
Host /Address
AAAA Name to IPV6
Host /Address
CNAME Point to another record Alias
PTR IP to Name
Pointer
MX Mail Server of a domain
Mail Exchanger
NS Name Server of a zone
Name Server
SOA Responsible Name Server Start of
Authority
SRV Service Location Records
DNS
Root Hints Server Cache Resolver Cache Iterative query

abc.com
bbc.com
How DNS Works…
cnn.com
123.com

IP

abc.com 123.com
bbc.com
cnn.com

www.abc.com

Recursive query Forwarding query


DNS
Stub zones

A stub zone is a copy of a zone that contains only those resource


records necessary to identify the authoritative Domain Name System
(DNS) servers for that zone. A stub zone is used to resolve names
between separate DNS namespaces

A stub zone consists of

SOA resource record, NS resource records, and the glue A resource


records for the delegated zone

The IP address of one or more master servers that can be used to


update the stub zone
DNS
Connect two DNS Infrastructure

abc.com bbc.com

?
www.bbc.com
www.abc.com
Create Secondary for bbc.com
Create Stub zone for bbc.com

Configure Alternate DNS Server in Client


Configure Forwarding
DNS
ISP
How DNS Forwarding Works…

abc.com bbc.com

www.yahoo.com
www.bbc.com
www.abc.com

Conditional Forwarding
Forward all Unknown queries to ISP DNS Server
DNS
Dynamic DNS

DDNS allows..

⮚ Dynamic creation of A And PTR records

⮚ Dynamically update A and PTR records

⮚ Integration with DHCP


DNS
Dynamic DNS

DNS DHCP 200.200.1.1-100


C1 = 1.1 1.2
C2 = 1.2
C3 = 1.3

C1 C2 C3
1.2
1.1 1.2
1.3 1.3
1.1

Philistia Learning
System
DNS
DNS Implimentation

Package bind
Script /etc/init.d/named
Daemon /usr/sbin/named
Port 53(Domain)
Configuration files /etc/named.conf
/etc/named.rfc1912.zones
/var/named/*

Philistia Learning
System
DNS
DNS Implimentation

1. Install package yum install bind*

2. Edit /etc/named.conf listen-on port 53 { give local IP


here; };
allow-query {change localhost to
any}

3. Add entry in /etc/named.rfc1912.zones

zone "zone name" IN {


type master;
file "zone file";
};
Philistia Learning
System
DNS
DNS Implimentation

4. Create DB file in /var/named/

$TTL 1D
@ IN SOA <hostname.> <responsible person.> (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
@ IN NS <hostname>
<hostname> IN A <IP>

Philistia Learning
System
DNS

DNS Implimentation

5. Set service status on chkconfig named on

6. Start service service named start

Philistia Learning
System
DNS
DNS Implimentation (Slave)

1. Edit master zone decleration in /etc/named.rfc1912.zones

zone "zone name" IN {


type master;
file "zone file";
allow-transfer { ip of slave server; };
};

Philistia Learning
System
DNS
DNS Implimentation (Slave)

2. Declare slave zone in /etc/named.rfc1912.zones

zone "zone name" IN {


type slave;
file "slaves/zone file";
masters { ip of master server; };
};

Philistia Learning
System
DNS

DNS Implimentation (Reverse Lookup Zone)

1. Declare zone in /etc/named.rfc1912.zones

zone "1.200.200.in-addr.arpa" IN {
type master;
file "zone file";
};

Philistia Learning
System
DNS

DNS Implimentation (Reverse Lookup Zone)

2. Create zone file in /var/named

$TTL 1D
@ IN SOA <hostname.> <responsible
person.> (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum

@ IN NS <hostname>

<Host portion of IP> IN PTR <FQDN.>

Philistia Learning
System
DNS

DNS Implimentation (Default forwarding)

Append a line in /etc/named.conf file inside options block

options {.
.
.
forwarders { IP of target name server; };
};

DNS Implimentation (Conditional forwarding)

Declare in /etc/named.rfc1912.zones zone "zone name" IN {


type forwarding;
forwarders { IP of target server};
};
Philistia Learning
System
DNS
DNS Implementation (Subdomain)
Declare sub domain in /var/named/zone file

$TTL 1D
@ IN SOA <hostname.> <responsible person.> (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
@ IN NS <hostname>
<hostname> IN A <IP>

$ORIGIN subdomain1.zonename.

www IN A <IP>

$ORIGIN subdomain2.zonename.
Philistia Learning
System
DNS

DNS Implementation (Testing)

Make DNS server itself a client

✔ dig zone name

✔ host any record name

✔ dig -x IP Address

Philistia Learning
System

You might also like