2. DNS-Definition
Name Space
Flat Name Space
Hierarchial Name Space
Domain Name Space
FULLY QUALIFIED DOMAIN NAME
PARTIALLY QUALIFIED DOMAIN NAME
Distribution of Name Space
Hierarchy of Name servers
Zones and Domains
DNS in Internet
Resolution
DNS Messages
3. To identify an entity, TCP/IP uses IP address
which uniquely identifies connection of host
to internet.
We prefer to use names instead of numeric
address.
So we need a system that can map a name to
a numeric address and vice versa.This is
called DOMAIN NAME SYSTEM.
4. When internet was small, mapping was done
using HOST FILE which was stored on every
host.
Host file had only two columns:name and
address.
But now a days whole information is divided
into smaller parts and each part is stored in
different computer.This is called DNS.
5. The process of mapping a unique name with
a unique IP address.
FLAT NAME SPACE-
A name is assigned to an address and name
is a sequence of characters without structure.
It cannot be used in large system such as
Internet.
6. HIERACHICAL NAME SPACE-
• Each name is made of several parts.
• The first part can define the nature of
organization.
• Second part can define the name and third
can define the departments in organization.
• For example
o Smart.pu.edu
o Smart.unix.com
7. To have a hierarchical name space,a DOMAIN
NAME SPACE was designed.
In this design the names are defined in an
inverted tree structure with the root at top.
The tree can have only 128 levels i.e. level
0(root) to level 127.
Tree consists of nodes and each node has a
LABEL.
8.
9. Each node in the tree has a domain name.
Full domain name is sequence of labels
separated by dots(.)
Domain name is read from node up to root.
Always ends in a null label i.e. last character
is a dot.
10.
11. FULLY QUALIFIED DOMAIN NAME(FQDN)
It contains the full name of host.
A label is terminated by a null string.
Ex-cs.hmme.com.
PARTIALLY QUALIFIED DOMAIN NAME
It starts from a node but doesn’t reaches
root.
A label is not terminated by null string.
Ex-cs.hmme
12. Domain is a sub tree
of domain name space.
Each domain can be
divided into sub
domains.
13.
14. Region over which
server has the
responsibility and
authority.
Zone is a part of
entire tree.
Server can divide
domain into smaller
domains.
15. ROOT SERVER-IT is a server whose zone
consist of whole tree.These servers are
distributed all around the world.
PRIMARY SERVER-A primary server loads all
information from the local disk file.
SECONDARY SERVER-It transfers the complete
information from the primary server and it is
called Zone transfer.
16.
17.
18. Mapping a name to an address or an address to a
name is called-address resolution.
RESOLVER-It access the closest DNS server with a
mapping request.If the server has the
information, it satisfies the resolver ; otherwise
refers the resolver to other servers to provide the
information.
MAPPING NAMES TO ADDRESSES-Resolver gives
domain name to the server and ask for address.
19. MAPPING ADDRESS TO NAMES
Resolver sends IP address to the server to be
mapped to domain name.
This is called PTR or Inverse query.
Server uses inverse domain.
IP address-121.45.34.132
Domain name-132.34.45.121.in-addr.arpa.
20.
21.
22. CACHING
When a server asks for mapping from another
server and receive the response, it stores the
information an its cache memory before
sending it to the clients.
If the same or other client asks for the same
mapping,it can check its cache and resolve
the problem.
23.
24.
25. In DNS, when there is a change,such as
adding a new host,removing a host or
changing an IP address, change must be
made to the DNS master file.
Manual updating is not possible due to size
of Internet.
It is used to update DNS master file
automatically.
26. DNS can use either UDP or TCP.
PORT NO.53 is used by servers.
If size of response message is more than 512
bytes,TCP connection is used,otherwise UDP
is used.
29. sudo gedit /etc/bind/named.conf.options
Uncomment and edit the forwarders block.
write google’s dns server
8.8.8.8;
8.8.4.4;
Restart bind9 service.
sudo service bind9 restart.
Test using dig –x 127.0.0.1
30. DNS configuration files are stored
in /etc/bind directory. Primary configuration file
is/etc/bind/named.conf.
Edit ‘/etc/bind/named.conf’ file.
sudo gedit /etc/bind/named.conf
Make sure it contains the following lines.
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
31. sudo gedit /etc/bind/named.conf.local
Add the lines
zone "javed.local" {
type master;
file "/etc/bind/forward.javed";
allow-transfer { 192.168.1.102; };
also-notify { 192.168.1.102; };
};
32. zone "1.168.192.in-addr.arpa" {
type master;
file "/etc/bind/reverse.javed";
allow-transfer { 192.168.1.102; };
also-notify { 192.168.1.102; };
};
Here,
forward.javed – Forward zone file
reverse.javed– Reverse zone file
192.168.1.102 – Slave DNS server
33. Create forward zone
sudo gedit /etc/bind/forward.javed
Add the following lines:
$TTL 86400
@ IN SOA masterdns.javed.local. root.javed.local.(
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL )
@ IN NS masterdns.javed.local.
@ IN NS secondarydns.javed.local.
@ IN A 192.168.1.101
@ IN A 192.168.1.102
@ IN A 192.168.1.103
masterdns IN A 192.168.1.101
secondarydns IN A 192.168.1.102
client IN A 192.168.1.103
34. sudo gedit /etc/bind/reverse.javed
Add follwing lines:
$TTL 86400
@ IN SOA masterdns.javed.local. root.javed.local. (
2011071002 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL )
@ IN NS masterdns.javed.local.
@ IN NS secondarydns.javed.local.
@ IN PTR javed.local.
masterdns IN A 192.168.1.101
secondarydns IN A 192.168.1.102
client IN A 192.168.1.103
101 IN PTR masterdns.javed.local.
102 IN PTR secondarydns.javed.local.
103 IN PTR client.javed.local.
35. Run the following commands one by one:
sudo chmod -R 755 /etc/bind
sudo chown -R bind:bind /etc/bind
36. Check DNS default configuration file:
sudo named-checkconf
/etc/bind/named.conf
sudo named-checkconf
/etc/bind/named.conf.local
If it returns nothing, your configuration is
valid.
37. sudo named-checkzone javed.local
/etc/bind/forward.javed
Sample output:
zone javed.local/IN: loaded serial 2011071001
OK
38. sudo named-checkzone javed.local
/etc/bind/reverse.javed
Sample Output:
zone javed.local/IN: loaded serial
2011071002
OK
Resatart bind9 service
sudo service bind9 restart
39. sudo gedit /etc/network/interfaces
Add the nameserver IP address:
auto eth0
iface eth0 inet static
address 192.168.1.101
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 192.168.1.101
dns-search javed.local
Reboot your system.