Sei sulla pagina 1di 46

Domain name system

Submitted by :
PRAVEENA RATIYA JAISWAL
(1GA14SCS02)

Outline

What is DNS?
What services does it provide?
How does it operate?
Message format
Types of messages

1GA14SCS02

What is DNS?

DNS is a host name to IP address translation

service
DNS is

a distributed database implemented in a hierarchy


of name servers

an application level protocol for message exchange


between clients and servers

1GA14SCS02

Why DNS?

It is easier to remember a host name than it is to

remember an IP address.

An name has more meaning to a user than a 4 byte

number.

Applications such as FTP, HTTP, email, etc., all require

the user to input a destination.

The user generally enters a host name.


The application takes the host name supplied by the user

and forwards it to DNS for translation to an IP address.


4

1GA14SCS02

DNS Services

Besides the address translation service, DNS also

provides the following services:

Host aliasing: a host with a complicated name can


have one or more aliases that are simpler to
remember,e.g., relay1.west-coast.media.com ->
media.com. The longer name is the canonical
hostname, the shorter the alias hostname.

1GA14SCS02

DNS Services (contd)

Mail server aliasing: same as above, aliases can


exist for long canonical host names.

Load Balancing: a set of servers can have one name


mapped onto several machines. DNS provides the
full list of names to the end users application which
generally takes the first one in the list. DNS rotates
the names on the list.

1GA14SCS02

How does it work?

DNS works by exchanging messages between

client and server machines.

A client application will pass the destination host

name to the DNS process (in Unix referred to as


the gethostbyname() routine) to get the IP
address.

The application then sits and waits for the

response to return.

1GA14SCS02

DNS

Why not centralize DNS?


single point of failure
traffic volume
distant centralized

database
maintenance

doesnt scale!
8

1GA14SCS02

Distributed, Hierarchical
Database
Root DNS Servers
com DNS servers
yahoo.com
DNS servers

amazon.com
DNS servers

org DNS servers


pbs.org
DNS servers

edu DNS servers


poly.edu
umass.edu
DNS serversDNS servers

Client wants IP for www.amazon.com; 1 st approx:


client queries a root server to find com DNS server
client queries com DNS server to get amazon.com

DNS server
client queries amazon.com DNS server to get IP

address for www.amazon.com


1GA14SCS02

INTRODUCTION

The protocols such as Internet protocols addresses

use binary values to identify hosts and routers.


Users prefer to assign machines pronouncable

easily remembered names


DNS is a scheme for assigning meaningful high

level names to a large set of machines and maps


between high level machine names and binary IP
addresses
10

1GA14SCS02

Names for Computers

It consists both translation from high level names

to ip addresses and vice-versa.


In a naming system ,name is an identifier that

consists sequence of characters chosen from finite


alphabet. Names are useful if system can
eeficiently map them to the object they donate.
An ip address can be think of a low level name.

11

1GA14SCS02

Flat Namespace

flat namespace is which in each name consisted of a


sequence of characters without any further structure.

Originally, A Network Information Center, administered


the namespace and determine whether the new name
was appropriate

Flat namespace is advantageous as the name are


convenient and short, whereas on the contrary it can
not generalize to large sets of machine for both
technical and administrative reasons
12

1GA14SCS02

As the names are drawn from a single set of

identifier, following conflict arise as the number of


sites increases:
Authoroty for adding new name rest at a single
site, administrative workload at that site increases
As the name to address binding change frequently,
the cost of maintaining correct copies of entire list
at each site is high and increases as the number of
sites increases

If the name database decides at a single site,


network traffic to that site increases with number
of sites
13

1GA14SCS02

Hierarchical Names

Without requiring a central site to administer and accommodate a

large naming system that rapidly expands set of names we can


have decentralized naming mechanism by delegating authority for
parts of namespace and distributing responsibility for mapping
between names and addresses.
The partitioning of a namespace must be defined in a way that

supports efficient name mapping and guarantees autonomous


control of name assignment
Optimizing can lead to solutions that retain a flat namespace and

reduce traffic by dividing the names among multiple mapping

14

1GA14SCS02

Example

To understand how namespace should be divided,

consider internal structure for large organization

At the top, a chief executive has overall responsibility

Organization is partitioned into divisions with an


executive in charge of each division

Chief executive grants each division autonomy within


specified limits

Executive in charge of particular division can hire or fire


employees, assign offices and delegate authorities,
without obtaining direct permission from chief executive.
15

1GA14SCS02

Delegation of authority for names

A hierarchal naming scheme works like management of a large


organization

The namespace is partitioned at top level and authority for names

subdivision is passed to designated agent.


One might

choose to 2 partition the namespace based on site name.

Ex. local.site
Where site is the site name authorised by central authority, local is part
of the name controlled by site and the period (.) character is delimiter
used to separate them.
When the topmost authority approved adding a new site, X to the list

of valid sites and delegates site X authority for all names that end in .X

16

1GA14SCS02

Subset Authority

In hierarchical namespace ,authority may be further subdivided at

each level.
The idea is to keep subdividing the namespace until each

subdivision is small enough to be manageable.


For example, adding a group subdivision to names already

partitioned by site produces the following name syntax :

local.group.site

The us telephone system :

The 10 digits phone number have been partitioned into 3 digit area
code , 3 digit exchange , and 4 digit subscriber within exchange.

17

1GA14SCS02

Summary

In internet ,the hierarchical macine names are

assigned according to the structure of


organizations that obtain authority for parts of
namespace, not necessarily according to the
structure of physical network interconnections.

18

1GA14SCS02

Internet Domain Names

The domain name system is the system that provides name to

address mapping for the internet.


2 conceptually independent aspects :

It specifies the name syntax and rules for delegating authority over
names

It specifies the implementation of a distributed computing system


that efficiently maps names to addresses.

It uses a hierarchical naming scheme known as domain names.


It has a sequence of subnames seperated by a delimiter character,

the dot
19

1GA14SCS02

Each section is called a label . Thus the domain name :

Cs.purdue.edu

Contains 3 labels : cs,purdue and edu


Any suffx of a label in a domain name is called a domain
In above example :

The lowest level domain is cs.purdue.edu (the domain name for


computer science department at purdue university)

The second level domain is purdue.edu(the domain name for


pudue university)

The top level domain name is edu (the domain name for
educational institutions).
20

1GA14SCS02

Top level domains


Domain
name

meaning

aero

Air transport industry

asia

Regional domain for Asia

biz

businesses

com

Commercial organization

edu

Educational institutions(4 years)

gov

United states government

info

information

jobs

Human resource management

mil

United states military

name

individuals

net

Major network support centers

org

organizations other than above

travel

Travel industry

Country code

Each country (geographical


21
scheme)

Figure.
The top
level
domains
assigned
in the
internet
and their
meanings.

1GA14SCS02

Contd.

The international corporation for assigned names and

numbers(ICANN) assigns names.


The top level names permit two different naming hierarchies :

Geographical.(divides universe of machines by country)

Organizational.(grouped by organization type)

Machines in united states fall under the top level domain us .


The authority for us domainhas chosen to divide it into one second

level domain per state : for eg.

Domain for the state of virginia is:

va.us

22

1GA14SCS02

A domain name registrar reviews the application

and assigns the organization a subdomain under


one of the existing top level domains.
The owner of a given top level domain can decide

what to allow and how to further partition the


namespace.
For example,in united kingdom ,which has the two

letter country code uk,universities and other


academic institutions are registered under domain
ac.uk.
23

1GA14SCS02

Internet domain hierarchy


Unnamed root

com
com

edu
edu

gov
gov

us
us

va
va
purdu
purdu
ee

ibm
ibm

ecn
ecn

cs
cs

nsf
nsf
reston
reston

mat
mat
hh

cnri
cnri
24

1GA14SCS02

Name syntax and type

To permit client to distinguish among multiple types of entries in the

system ,each named item stored is assigned a type that specifies


whether it is the address of a computer , a mailbox, a user , and so on.
When resolving a name , the answer received depends on the type

specified in the query.


Thus if a user sends email to someone at x.com and types x.com into a

browser,the two actions may result in contacting two entirely different


computers.
One cannot distinguish the names of subdomains from the names of

individual objects or the type of an object using only the domain name
syntax.

25

1GA14SCS02

Mapping domain names to


addresses

The domain mechanism for mapping names to

addresses consists of independent, cooperative


systems called name servers.
A name server is a server program that supplies name

to address translation ,mapping from domain names to


ip addresses.
The client software called a name resolver may contact

one or more name servers when translating a name.

26

1GA14SCS02

Domain name resolution

There are two ways to use the domain name system :

by contacting name server one at a time

Asking the name server system to perform the complete


translation.

The client sends the query to a name server for resolution.


When the server receives query ,it checks to see if the name lies

in the subdomain for which it is an authority.


If so ,it translates the name to an address according to database

and appends an answer to query befor sending it back to client.

27

1GA14SCS02

If the name server cannot resolve the name

completely , it checks to see what type of


interaction the client specified .
If the client request complete translation

(recursive resolution ), the server contacts a


domain name server that can resolve the name
and returns the answer to client.

28

1GA14SCS02

If the client requested non-recursive resolution (iterative

resolution),the name server cannot supply an answer.


It generates a reply that specifies the name server the

client should contact to resolve the name.


Domain name servers use a well known protocol port

for all communications ,so client know how to


communicate with a name server once they know the ip
address of the machine in which the server executes.

29

1GA14SCS02

Efficient translation

Inefficiencies in resolution can arise because of three reasons :

Most name resolution refers to local names ,tracing a path through


the hierarchy to contact the local authority would be inefficient.

If each name resolution always started by contacting the top level


hierarchy ,the machine at that point would become overloaded.

Failure of machines at the top level of hierarchy would prevent name


resolution ,even if the local authority could resolve the name.

In the two-step name resolution process, resolution process begins

with local name server .

30

1GA14SCS02

Caching : the key to


efficiency
To improve overall performance of a name server system it is

necessary to lower the cost of lookup for nonlocal names.


Each server maintains a cache of answers to recent lookups

as well as record of where the answer was obtained.


Servers report cached information to client ,but mark it as a

nonauthoritative binding and give the domain name of the


server, S ,from which they obtained binding.
Therefore clients receive answers quickly, but the information

may be out of date.


31

1GA14SCS02

To keep the cache correct, servers only save

cached information while the information is valid


once it becomes stale ,server removes the item
from cache.
DNS , allows the authority for an entry to

configure its timeout.


Whenever an authority responds to a request , the

authority includes a Time To Live(TTL) value in the


response that specifies how long the binding wil
remain valid.
32

1GA14SCS02

Domain name system message


format
0

16

31

IDENTIFICATION

PARAMETER

Number of questions

Number of answers

Number of authority

Number of additional

Question section
Answer section
Authority section
Additional information section
Figure . Domain name server message format.

33

1GA14SCS02

16

31

Query domain name


Query type

Query class

Figure. The format for entries in the question section of a


domain name server message.
0

16
Resource domain
Type

31
Class

Time to live
Resource data length
Resource data
Figure . The format of a resource record used in later sections of
message returned by domain name servers.
34

1GA14SCS02

TLD and Authoritative


Servers
Top-level domain (TLD) servers:
responsible for com, org, net, edu, etc, and
all top-level country domains uk, fr, ca, jp.
Network Solutions maintains servers for com
TLD
Educause for edu TLD
Authoritative DNS servers:
organizations DNS servers, providing
authoritative hostname to IP mappings for
organizations servers (e.g., Web, mail).
can be maintained by organization or service
provider
35
1GA14SCS02

Local Name Server

does not strictly belong to hierarchy


each ISP (residential ISP, company, university) has

one.

also called default name server

when host makes DNS query, query is sent to its

local DNS server

acts as proxy, forwards query into hierarchy

36

1GA14SCS02

DNS Queries

Recursive:
The client machine sends a request to the local
name server, which, if it does not find the address in
its database, sends a request to the root name
server, which, in turn, will route the query to an
intermediate or authoritative name server. Note that
the root name server can contain some hostname to
IP address mappings. The intermediate name server
always knows who the authoritative name server is.

37

1GA14SCS02

DNS Queries (contd)

Iterative:
The local server queries the root server. If address
not in its database, will have the name/address of an
intermediate or authoritative name server and
forward that information to the local name server so
that it can directly communicate with the
intermediate or authoritative name server. This is to
prevent the overloading of the root servers that
handle millions of requests.

38

1GA14SCS02

DNS name resolution example

root DNS
server

Host at cis.poly.edu

wants IP address
for
gaia.cs.umass.edu

iterated query:

contacted server
replies with name of
server to contact
I dont know this
name, but ask this
server

TLD DNS
server

4
5
local DNS server
dns.poly.edu

authoritative DNS server


dns.cs.umass.edu

requesting host
cis.poly.edu

gaia.cs.umass.edu

39

1GA14SCS02

DNS name resolution example


root DNS
server
recursive query:

puts burden of
name resolution on
contacted name
server
heavy load?

3
6

TLD DNS
server

local DNS server


dns.poly.edu

8
authoritative DNS server
dns.cs.umass.edu

requesting host
cis.poly.edu

gaia.cs.umass.edu
40

1GA14SCS02

DNS: caching and updating


records
once (any) name server learns mapping, it

caches mapping

cache entries timeout (disappear) after some time

TLD servers typically cached in local name servers

Thus root name servers not often visited

update/notify mechanisms under design by

IETF

RFC 2136

http://www.ietf.org/html.charters/dnsind-charter.html

41

1GA14SCS02

Operation of DNS

DNS uses caching to increase the speed with

which it does the translation.

The DNS data is stored in the database in the form

of resource records (RR). The RRs are directly


inserted in the DNS messages.

The RRs are a 4 tuple that consist of: {name,

value, type, TTL}.

42

1GA14SCS02

DNS protocol, messages


DNS protocol : query and reply messages, both with same message format

msg header

identification: 16 bit #
for query, reply to
query uses same #
flags:
query or reply
recursion desired
recursion available
reply is authoritative

43

1GA14SCS02

DNS protocol, messages


Name, type fields
for a query
RRs in response
to query
records for
authoritative
servers
additional
helpful
info that may be
used
44

1GA14SCS02

Message Fields

Identification - identifies a query and is copied in

the reply message to match it to the query at the


client side.

Flags - one bit flag set to indicate whether the

message is a query or a reply. Another bit to


identify if reply is from an authoritative sender or
not. A third bit is used to indicate that recursion
method is desired.

45

1GA14SCS02

Fields contd

Questions - contains the name that is being

queried and the type, ie type A or MX.

Answers - contains the RRs for the name(s) that

were requested

Authority - contains records of authoritative servers


Additional Info - e.g., if type of query is MX, then

this info can be a Type - A RR containing the IP


address of the canonical hostname
46

1GA14SCS02

Potrebbero piacerti anche