Sunteți pe pagina 1din 30

NEEDOFDNS

To identify an entity, the Internet uses the IP address,


which uniquely identifies the connection of a host to the
Internet. However, people prefer touse names instead of
addresses. Therefore, we need a system that can map a
name to an address or an address to a name.
HISTORYOFDNS
When the Internet was small, mapping was done using a
host file. The host file had only two columns: one for the
name and one for the address. Every host could store the
host file on its disk and update it periodically from a
master host file. When a program or user wanted to map
a name to an address, the host consulted the host file and
found the mapping.
Today, however, it is impossible to have one single host
file relate every address to a name and vice versa. The
host file would be too large to store in every host.
In addition, it would be impossible to update all the host
files in the world every time there is a change.
One solution would be to store the entire host file in a
single computer and allow access to this centralized
information to every computer thatneeds a mapping. But
this would create huge amount of traffic on the Internet.
INTRODUCTION
Another solution, the one used today, is to divide this
huge information into smaller parts and store each part
on a different computer. In this method, the host that
needs mapping can contact the closest computerholding
the needed information. This method is used by the
Domain Name System(DNS).
Design principle of DNS
The naming system on which DNSis based is a hierarchical and logical tree
structure called the domainnamespace.

An organization obtains authority for parts of the name space, and can add
additional layers of the hierarchy

In practice, allocation of the domain names generally follows the allocation of IP


address, e.g.,
All hosts withnetwork prefix 128.143/16 have domain name suffix
virginia.edu
All hosts on network 128.143.136/24 are in the Computer Science
Department of the University ofVirginia
NAME SPACE
A name space that maps each address to a unique name
can be organized in two ways:
a. FLATNAMESPACE
In this, a name is assigned to an address. A namein
this space is a sequence without structure.
Disadvantage: Cannot be used in large systems like
Internet because it must be centrally controlled to
avoid ambiguity and duplication.
b. HIERARCHIALNAMESPACE
• Each name is made of several parts.
• The first part can define the nature of organization, the
second part can define the name, the third part can define
departments and so on.
• The authority to assign and control the name spaces canbe
decentralized.
DOMAIN NAME SPACE
To have a hierarchical name space, Domain Name Space
was designed. In this design, the names are defined in an
inverted-tree structure with the root at the top. The tree
can have only 128 levels: level 0 (root) to level 127. Each
level of the tree defines a hierarchical level.
The DNSNameSpace

A portion of the Internet domain name space.


LABEL: Each node in a tree has a label, which is a string
with a maximum of 63 characters. The root label is a null
string. DNSrequires that children of a node havedifferent
labels, which guarantees the uniqueness of the domain
names.

DOMAIN NAME: Each node in the tree has a domain


name. A full domain name is a sequence of labels
separated by dots(.). The domain names are alwaysread
from the node upto the root.
Domain name system .

Each node in the DNStree represents


a DNSname edu
Each branch below a node is a DNS
domain.
DNSdomain can contain hosts or virginia.edu
other domains (subdomains)

www.virginia.edu cs.virginia.edu
Example:
DNSdomains are
., edu, virginia.edu, cs.virginia.edu
neon.cs.virginia.edu
FULLYQUALIFIED DOMAIN NAME (FQDN):
Every node in the DNSdomain tree can be identified by a unique
Fully Qualified Domain Name (FQDN). The FQDN gives the
position in the DNStree.
In this, the label is terminated by a nullstring.
It is a domain name that contains the full name of the host.
It contains all labels, from the most specific to the most general,
that uniquely define the host.

PARTIALLYQUALIFIED DOMAIN NAME (PQDN)


In this, the label is not terminated by a null string.
A PQDN starts with a node but does not reach the root.
It is used when the name to be resolved belongs tothe same site
as the client.
Top-level domains
Three types of top-leveldomains:
Organizational: 3-character code indicates the function of the
organization
Used primarily within the US
Examples: gov, mil, edu, org, com, net
Geographical: 2-character country or regioncode
Examples: us, va, jp, de
Reverse domains: A special domain (in-addr.arpa) used for IP
address-to-name mapping

There are more than 200 top-leveldomains.


Organizational top-level domains
com Commercial organizations

edu Educational institutions

gov Government institutions

int International organizations

mil U.S. military institutions

net Networking organizations

org Non-profit organizations


DISTRIBUTION OFNAME SPACE
Hierarchy of nameservers
The resolution of the root server

hierarchical name space is


done by a hierarchy of name
servers

Each server is responsible


(authoritative) for a
contiguous portion of theDNS org server edu server gov server com server

namespace, called a zone.

Zone is a part of the subtree uci.edu .virginia.edu


server server

DNSserver answers queries


about hosts in its zone
cs.virginia.edu
server
Authority and Delegation
Authority for the root domain is with the Internet
Corporation for Assigned Numbers and Names(ICANN)
ICANN delegates to accredited registrars (for gTLDs) and
countries for country code top level domains (ccTLDs)
Authority can be delegated further

Chain of delegation can be obtained by reading domain


name from right to left.
Unit of delegation is a“zone”.
DNSDomains andZones
. (root)
Each zone is anchored at a
specific domain node, but
zones are not domains. Zone
.edu

A DNS domain is a branchof


the namespace .uci.edu
.virginia.edu

A zone is a portion of the DNS


namespace generally stored in math.virginia.edu cs.virginia.edu
a file (It could consists of
multiple nodes)
Zone
Domain
A server can divide part of its and
zone and delegate it to other domain
servers
Primary and Secondary Name Servers
For each zone, there must be a primary name server and asecondary
name server
The primary server (master server) maintains a zone file which has
information about the zone. Updates are made to the primary server
The secondary server copies data stored at the primaryserver.

Adding a host:
When a new host is added (“gold.cs.virginia.edu”) to a zone, the
administrator adds the IP information on the host (IP address and name)to
a configuration file on the primaryserver
RESOURCERECORDS
db.mylab.com
The database records of
the distributed data base $TTL 86400
mylab.com. IN SOA PC4.mylab.com.
are called resource records hostmaster.mylab.com. (
(RR) 1 ;serial
28800 ; refresh
Resource records are 7200 ; retry
604800 ; expire
stored in configurationfiles 86400 ; ttl
)
(zone files) at name
servers. ;
mylab.com. IN NS PC4.mylab.com.
;
localhost A 127.0.0.1
Left Resource records for a PC4.mylab.com.
PC3.mylab.com.
A
A
10.0.1.41
10.0.1.31
zone: PC2.mylab.com. A 10.0.1.21
PC1.mylab.com. A 10.0.1.11
Resource Records

The principal DNS resource records types.


Resource Records
db.mylab.com

Max. age of cached data


$TTL 86400 in seconds
mylab.com. IN SOA PC4.mylab.com. hostmaster.mylab.com. (
1 ; serial
*Start of authority (SOA) record.
28800 ; refresh Means: “This name server is
7200 ; retry authoritative for the zone
604800 ; expire Mylab.com”
86400 ; ttl *PC4.mylab.com is the
) name server
*hostmaster@mylab.com is the
;
mylab.com. IN NS PC4.mylab.com.
email address of the person
; in charge
localhost A 127.0.0.1
PC4.mylab.com. A 10.0.1.41 Name server (NS)record.
PC3.mylab.com. A 10.0.1.31 One entry for each authoritative
PC2.mylab.com. A 10.0.1.21 name server
PC1.mylab.com. A 10.0.1.11
Address (A) records.
One entry for each hostaddress
Resolver and name server
1. An application program on a host
accesses the domain system through Hostname (neon.tcpip-lab.edu)

a DNSclient, called the resolver HTTP IP address (128.143.71.21) Resolver


2. Resolver contacts DNSserver, called
name server

IP address (128.143.71.21)

(neon.tcpip-lab.edu)
3. DNSserver returns IP address to

Hostname
resolver which passes the IPaddress
to application

Reverse lookups are also possible,


i.e., find the hostname given an IP Name
server
address
Domain name resolution
1. User program issues a request for
the IP address of ahostname
Hostname (neon.tcpip-lab.edu)
2. Local resolver formulates a DNS
query to the name server of the host HTTP IP address (128.143.71.21) Resolver

3. Name server checks if it is

IP address (128.143.71.21)
authorized to answer thequery.

(neon.tcpip-lab.edu)
a) If yes, it responds.

Hostname
b) Otherwise, it will query other
name servers, starting at the
root tree
4. When the name server has the Name
server
answer it sends it to the resolver.
Recursive and Iterative Queries
There are two types of queries:
Recursive queries
Iterative (non-recursive) queries

The type of query is determined by a bit in the DNSquery

Recursive query: When the name server of a host cannot


resolve a query, the server issues a query to resolve thequery
Iterative queries: When the name server of a host cannot
resolve a query, it sends a referral to another server to the
resolver
Recursive queries
root server
In a recursive query, the resolver 1st query: neon.cs.virginia.edu

expects the response from the name


Referral to edu name server
server

If the server cannot supply the 2nd query: neon.cs.virginia.edu


answer, it will send the query to the Referral to virginia.edu name
“closest known” authoritative name server
server (here: In the worst case, the Name edu server
closest known server is the root server 3rd query:
neon.cs.virginia.edu
server)
Referral to
response

query
cs.virginia.edu
The root sever sends a referral to the name server virginia.edu
“edu” server. Querying this server server
4th query:
yields a referral to the serverof neon.cs.virginia.edu
“virginia.edu”
Resolver IP address of
…and so on neon.cs.virginia.edu
cs.virginia.ed
server
Iterative queries root server

Name
In an iterative query, the nameserver server
sends a closest known authoritative
name server a referral to the root

referral to root server


server. edu server

query
This involves more work for the
resolver
virginia.edu
server

Resolver 4th query:


neon.cs.virginia.edu

IP address of cs.virginia.ed
neon.cs.virginia.edu server
Caching
To reduce DNStraffic, name servers caches information on
domain name/IP addressmappings
When an entry for a query is in the cache, the server does not
contact other servers
Note: If an entry is sent from a cache, the reply from the
server is marked as“unauthoritative”

S-ar putea să vă placă și