ITEC310 Computer Networks II: Objectives
ITEC310 Computer Networks II: Objectives
Computer Networks II
Chapter 25
Domain Name System
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution
DNS Messages
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 2/57
Objectives
• After completing this chapter you should be able to
do the following:
– Discuss the Domain Name System (DNS) which is a
client/server application that provides name services
for other applications.
– Discuss how DNS enables the use of application
layer addresses, such as an e-mail address, instead
of network layer logical addresses.
1
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution
DNS Messages
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 3/57
Introduction
• There are several applications in the application layer of
the Internet model that follow the client/server model.
• The client/server programs can be divided into two
categories:
– Those that can be directly used by the user, such as e-mail.
– Those that support other application programs.
• The Domain Name System (DNS) is a supporting
program that is used by other programs such as e-mail.
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution
DNS Messages
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 4/57
Introduction
• Figure shows an example of how a DNS client/server program can
support an e-mail program to find the IP address of an e-mail recipient.
– A user of an e-mail program may know the e-mail address of the recipient;
however, the IP protocol needs the IP address.
– The DNS client program sends a request to a DNS server to map the e-mail
address to the corresponding IP address.
2
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution Flat Name Space
DNS Messages Hierarchical Name Space
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 5/57
Name Space
• The names assigned to machines must be unique because
the addresses are unique.
• A name space that maps each address to a unique name
can be organized in two ways:
– Flat
– Hierarchical
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution Flat Name Space
DNS Messages Hierarchical Name Space
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 6/57
Name Space
• In a flat name space, a name is assigned to an address.
• A name in this space is a sequence of characters without
structure.
• The main disadvantage of a flat name space is that it
cannot be used in a large system such as the Internet
because it must be centrally controlled to avoid ambiguity
and duplication.
3
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution Flat Name Space
DNS Messages Hierarchical Name Space
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 7/57
Name Space
• In a hierarchical name space, each name is made of
several parts.
– The first part can define the nature of the organization, the
second part can define the name of an organization, the third
part can define departments in the organization, and so on.
• In this case, the authority to assign and control the name
spaces can be decentralized.
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet Label
Resolution
DNS Messages Domain Name
Types of Records Domain
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 8/57
4
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet Label
Resolution
DNS Messages Domain Name
Types of Records Domain
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 9/57
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet Label
Resolution
DNS Messages Domain Name
Types of Records Domain
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 10/57
10
5
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet Label
Resolution
DNS Messages Domain Name
Types of Records Domain
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 11/57
11
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet Label
Resolution
DNS Messages Domain Name
Types of Records Domain
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 12/57
12
6
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet Label
Resolution
DNS Messages Domain Name
Types of Records Domain
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 13/57
13
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet Label
Resolution
DNS Messages Domain Name
Types of Records Domain
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 14/57
14
7
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Hierarchy of Name Servers
Resolution Zone
DNS Messages Root Server
Types of Records
Registrars Primary and Secondary Servers
Dynamic Domain Name System (DDNS)
Encapsulation 15/57
15
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Hierarchy of Name Servers
Resolution Zone
DNS Messages Root Server
Types of Records
Registrars Primary and Secondary Servers
Dynamic Domain Name System (DDNS)
Encapsulation 16/57
16
8
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Hierarchy of Name Servers
Resolution Zone
DNS Messages Root Server
Types of Records
Registrars Primary and Secondary Servers
Dynamic Domain Name System (DDNS)
Encapsulation 17/57
17
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Hierarchy of Name Servers
Resolution Zone
DNS Messages Root Server
Types of Records
Registrars Primary and Secondary Servers
Dynamic Domain Name System (DDNS)
Encapsulation 18/57
18
9
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Hierarchy of Name Servers
Resolution Zone
DNS Messages Root Server
Types of Records
Registrars Primary and Secondary Servers
Dynamic Domain Name System (DDNS)
Encapsulation 19/57
19
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Hierarchy of Name Servers
Resolution Zone
DNS Messages Root Server
Types of Records
Registrars Primary and Secondary Servers
Dynamic Domain Name System (DDNS)
Encapsulation 20/57
20
10
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Hierarchy of Name Servers
Resolution Zone
DNS Messages Root Server
Types of Records
Registrars Primary and Secondary Servers
Dynamic Domain Name System (DDNS)
Encapsulation 21/57
21
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Hierarchy of Name Servers
Resolution Zone
DNS Messages Root Server
Types of Records
Registrars Primary and Secondary Servers
Dynamic Domain Name System (DDNS)
Encapsulation 22/57
22
11
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet Generic Domains
Resolution
DNS Messages Country Domains
Types of Records Inverse Domain
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 23/57
23
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet Generic Domains
Resolution
DNS Messages Country Domains
Types of Records Inverse Domain
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 24/57
24
12
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet Generic Domains
Resolution
DNS Messages Country Domains
Types of Records Inverse Domain
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 25/57
Table 25.1
Generic domain labels
ITEC310 Computer Networks II
Eastern Mediterranean University, Department of Information Technology
25
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet Generic Domains
Resolution
DNS Messages Country Domains
Types of Records Inverse Domain
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 26/57
26
13
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet Generic Domains
Resolution
DNS Messages Country Domains
Types of Records Inverse Domain
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 27/57
27
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet Generic Domains
Resolution
DNS Messages Country Domains
Types of Records Inverse Domain
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 28/57
28
14
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet Generic Domains
Resolution
DNS Messages Country Domains
Types of Records Inverse Domain
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 29/57
29
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet Generic Domains
Resolution
DNS Messages Country Domains
Types of Records Inverse Domain
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 30/57
30
15
Name Space
Domain Name Space Resolver
Distribution of Name Space
DNS in the Internet
Mapping Names to Addresses
Resolution Mapping Address to Names
DNS Messages Recursive Resolution
Types of Records
Registrars Iterative Resolution
Dynamic Domain Name System (DDNS) Caching
Encapsulation 31/57
Resolution
• Mapping a name to an address or an address to a name is
called name-address resolution.
• A host that needs to map an address to a name or a name
to an address calls a DNS client called a resolver.
• The resolver accesses the closest DNS server with a
mapping request.
– If the server has the information, it satisfies the resolver;
otherwise, it either refers the resolver to other servers or asks
other servers to provide the information.
• After the resolver receives the mapping, delivers the result
to the process that requested it.
ITEC310 Computer Networks II
Eastern Mediterranean University, Department of Information Technology
31
Name Space
Domain Name Space Resolver
Distribution of Name Space
DNS in the Internet
Mapping Names to Addresses
Resolution Mapping Address to Names
DNS Messages Recursive Resolution
Types of Records
Registrars Iterative Resolution
Dynamic Domain Name System (DDNS) Caching
Encapsulation 32/57
Resolution
• Most of the time, the resolver gives a domain name to the server
and asks for the corresponding address.
• The server checks the generic domains or the country domains
to find the mapping.
– If the domain name is from the generic domains section, the
resolver receives a domain name such as "chal.atc.fhda.edu.".
• The query is sent by the resolver to the local DNS server for resolution.
• If the local server cannot resolve the query, it either refers the resolver
to other servers or asks other servers directly.
– If the domain name is from the country domains section, the
resolver receives a domain name such as "ch.fhda.cu.ca.us.".
• The procedure is the same.
32
16
Name Space
Domain Name Space Resolver
Distribution of Name Space
DNS in the Internet
Mapping Names to Addresses
Resolution Mapping Address to Names
DNS Messages Recursive Resolution
Types of Records
Registrars Iterative Resolution
Dynamic Domain Name System (DDNS) Caching
Encapsulation 33/57
Resolution
• A client can send an IP address to a server to be mapped to a
domain name.
– This is called a PTR query.
• To answer queries of this kind, DNS uses the inverse domain.
• In the request, the IP address is reversed and the two labels in-
addr and arpa are appended to create a domain acceptable by
the inverse domain section.
– For example, if the resolver receives the IP address
132.34.45.121, the resolver first inverts the address and then adds
the two labels before sending.
• The domain name sent is "121.45.34.132.in-addr.arpa." which
is received by the local DNS and resolved.
ITEC310 Computer Networks II
Eastern Mediterranean University, Department of Information Technology
33
Name Space
Domain Name Space Resolver
Distribution of Name Space
DNS in the Internet
Mapping Names to Addresses
Resolution Mapping Address to Names
DNS Messages Recursive Resolution
Types of Records
Registrars Iterative Resolution
Dynamic Domain Name System (DDNS) Caching
Encapsulation 34/57
Resolution
• The client (resolver) can ask for a recursive answer from a name
server.
– This means that the resolver expects the server to supply the final
answer.
• If the server is the authority for the domain name, it checks its
database and responds.
• If the server is not the authority, it sends the request to another
server (the parent usually) and waits for the response.
– If the parent is the authority, it responds; otherwise, it sends the
query to yet another server.
• When the query is finally resolved, the response travels back
until it finally reaches the requesting client.
• This is called recursive resolution.
ITEC310 Computer Networks II
Eastern Mediterranean University, Department of Information Technology
34
17
Name Space
Domain Name Space Resolver
Distribution of Name Space
DNS in the Internet
Mapping Names to Addresses
Resolution Mapping Address to Names
DNS Messages Recursive Resolution
Types of Records
Registrars Iterative Resolution
Dynamic Domain Name System (DDNS) Caching
Encapsulation 35/57
Resolution
• The recursive resolution is
shown in figure.
35
Name Space
Domain Name Space Resolver
Distribution of Name Space
DNS in the Internet
Mapping Names to Addresses
Resolution Mapping Address to Names
DNS Messages Recursive Resolution
Types of Records
Registrars Iterative Resolution
Dynamic Domain Name System (DDNS) Caching
Encapsulation 36/57
Resolution
• If the client does not ask for a recursive answer, the mapping
can be done iteratively.
– If the server is an authority for the name, it sends the answer.
– If it is not, it returns (to the client) the IP address of the server that
it thinks can resolve the query.
– The client is responsible for repeating the query to this second
server.
– If the newly addressed server can resolve the problem, it answers
the query with the IP address; otherwise, it returns the IP address
of a new server to the client.
– Now the client must repeat the query to the third server.
• This process is called iterative resolution because the client
repeats the same query to multiple servers.
ITEC310 Computer Networks II
Eastern Mediterranean University, Department of Information Technology
36
18
Name Space
Domain Name Space Resolver
Distribution of Name Space
DNS in the Internet
Mapping Names to Addresses
Resolution Mapping Address to Names
DNS Messages Recursive Resolution
Types of Records
Registrars Iterative Resolution
Dynamic Domain Name System (DDNS) Caching
Encapsulation 37/57
Resolution
• In figure the client queries four servers before it gets an answer
from the mcgraw.com server.
37
Name Space
Domain Name Space Resolver
Distribution of Name Space
DNS in the Internet
Mapping Names to Addresses
Resolution Mapping Address to Names
DNS Messages Recursive Resolution
Types of Records
Registrars Iterative Resolution
Dynamic Domain Name System (DDNS) Caching
Encapsulation 38/57
Resolution
• Each time a server receives a query for a name that is not
in its domain, it needs to search its database for a server IP
address.
• Reduction of this search time would increase efficiency.
• DNS handles this with a mechanism called caching.
• When a server asks for a mapping from another server and
receives the response, it stores this information in its cache
memory before sending it to the client.
• If the same or another client asks for the same mapping, it
can check its cache memory and solve the problem.
38
19
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution
DNS Messages Header
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 39/57
DNS Messages
• DNS has two types of messages: query and response.
– Both types have the same format.
• The query message consists of a header and question
records.
• The response message consists of a header, question
records, answer records, authoritative records, and
additional records.
39
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution
DNS Messages Header
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 40/57
DNS Messages
40
20
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution
DNS Messages Header
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 41/57
DNS Messages
• Both query and response messages have the same header
format with some fields set to zero for the query messages.
• The header is 12 bytes.
41
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution
DNS Messages Header
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 42/57
DNS Messages
42
21
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution
DNS Messages Header
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 43/57
DNS Messages
43
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution
DNS Messages Header
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 44/57
DNS Messages
44
22
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution
DNS Messages Header
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 45/57
DNS Messages
45
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution Question Record
DNS Messages Resource Record
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 46/57
Types of Records
• Two types of records are used in DNS.
– The question records are used in the question section of
the query and response messages.
– The resource records are used in the answer, authoritative,
and additional information sections of the response message.
46
23
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution Question Record
DNS Messages Resource Record
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 47/57
Types of Records
• A question record is used by the client to get information
from a server.
• This contains the domain name.
47
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution Question Record
DNS Messages Resource Record
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 48/57
Types of Records
• Each domain name (each node on the tree) is associated
with a record called the resource record.
• The server database consists of resource records.
• Resource records are also what is returned by the server to
the client.
48
24
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution
DNS Messages
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 49/57
Registrars
• How are new domains added to DNS?
• This is done through a registrar, a commercial entity.
• A registrar first verifies that the requested domain name is
unique and then enters it into the DNS database.
• A fee is charged.
49
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution
DNS Messages
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 50/57
Registrars
• To register, the organization needs to give the name of its
server and the IP address of the server.
– For example, a new commercial organization named
wonderful with a server named ws and IP address
200.200.200.5 needs to give the following information to one
of the registrars:
• Domain name: ws.wonderful.com
• IP address: 200.200.200.5
50
25
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution
DNS Messages
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 51/57
51
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution
DNS Messages
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 52/57
Encapsulation
• DNS can use either UDP or TCP.
• In both cases the well-known port used by the server is port
53.
• UDP is used when the size of the response message is
less than 512 bytes because most UDP packages have a
512-byte packet size limit.
• If the size of the response message is more than 512 bytes,
a TCP connection is used.
52
26
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution
DNS Messages
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 53/57
Summary
• The Domain Name System (DNS) is a client/server
application that identifies each host on the Internet with a
unique user-friendly name.
• DNS organizes the name space in a hierarchical structure
to decentralize the responsibilities involved in naming.
• DNS can be pictured as an inverted hierarchical tree
structure with one root node at the top and a maximum of
128 levels.
• Each node in the tree has a domain name.
• A domain is defined as any subtree of the domain name
space.
ITEC310 Computer Networks II
Eastern Mediterranean University, Department of Information Technology
53
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution
DNS Messages
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 54/57
Summary
• The name space information is distributed among DNS
servers. Each server has jurisdiction over its zone.
• A root server’s zone is the entire DNS tree.
• A primary server creates, maintains, and updates
information about its zone.
• A secondary server gets its information from a primary
server.
• The domain name space is divided into three sections:
generic domains, country domains, and inverse domain.
• There are 14 generic domains, each specifying an
organization type.
ITEC310 Computer Networks II
Eastern Mediterranean University, Department of Information Technology
54
27
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution
DNS Messages
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 55/57
Summary
• Each country domain specifies a country.
• The inverse domain finds a domain name for a given IP
address. This is called address-to-name resolution.
• Name servers, computers that run the DNS server program,
are organized in a hierarchy.
• The DNS client, called a resolver, maps a name to an
address or an address to a name.
• In recursive resolution, the client sends its request to a
server that eventually returns a response.
• In iterative resolution, the client may send its request to
multiple servers before getting an answer.
ITEC310 Computer Networks II
Eastern Mediterranean University, Department of Information Technology
55
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution
DNS Messages
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 56/57
Summary
• Caching is a method whereby an answer to a query is
stored in memory (for a limited time) for easy access to
future requests.
• A fully qualified domain name (FQDN) is a domain name
consisting of labels beginning with the host and going back
through each level to the root node.
• A partially qualified domain name (PQDN) is a domain
name that does not include all the levels between the host
and the root node.
56
28
Name Space
Domain Name Space
Distribution of Name Space
DNS in the Internet
Resolution
DNS Messages
Types of Records
Registrars
Dynamic Domain Name System (DDNS)
Encapsulation 57/57
Summary
• There are two types of DNS messages: queries and
responses.
• There are two types of DNS records: question records and
resource records.
• Dynamic DNS (DDNS) automatically updates the DNS
master file.
• DNS uses the services of UDP for messages of less than
512 bytes; otherwise, TCP is used.
57
29