mcgraw-hill©the mcgraw-hill companies, inc., 2004 1 chapter 25 domain name system
Post on 20-Dec-2015
213 views
TRANSCRIPT
2McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
IP address identifies the connection of a host to the Internet.
People prefer names instead of IP. Host file: maps name and address; stored in
local disk; Any program can consult the host file. With large number of users, it is not possible to
have all the host name mappings in a single file. Divide this huge amount of information into
small parts and store each part on a different computer DNS.
Namespace: Names must be unique like IP addresses. A name space that maps each address to a unique
name can be organized as: flat or hierarchical
3McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Flat name space A name is assigned to an address. Name is a sequence of characters without structure Due to central control for ambiguity, this is not
possible on huge networks like Internet. Hierarchical Name space
Each name is made of several parts. 1st part is nature of organization, 2nd part is name, … Central authority takes control of 1st and 2nd part
only. No need to worry of internal names or host names. Ex. Kfupm.edu.sa & ccse.kfupm.edu.sa
4McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 25.1 Domain Name Space
Names are defined in an inverted-tree structure with the root at the top.
Can have 128 levels: level 0 (root) to level 127. Label:
Each node in the tree has a level Maximum of 63 characters. Root label is a null string (empty string). Children of a node have different labels.
5McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 25.2 Domain Names and Labels
Full domain name is a sequence of labels separated by dots.
Domain names are always read from the node up to the root. Last label is the label of root (null). So, full domain name always ends in a null label [means dot].
6McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 25.3 FQDN and PQDN
Fully Qualified Domain Name (FQDN) Label is terminated by a null string. Contains the full name of a host.
Partially Qualified Domain Name (PQDN) Not terminated by a null string. PQDN starts from a node, but it does not reach the
root. Used when the name to be resolved belongs to the
same site as the client. Resolver supplies the missing part called as suffix.
7McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 25.4 Domains
Domain: Sub-tree of the domain name space. Name of the domain is the domain name of
the node at the top of the sub-tree. A domain can be divided into sub-domains.
8McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Distribution of Name Space
If information is stored in one machine, the requests will overload the machine.
Hierarchy of name servers Distribute among DNS servers. Let root stand alone and create as many domains
(subtrees) as there are first-level nodes. Each server can be responsible (authoritative) for
either a large or a small domain.
9McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 25.6 Zones and domains Zone
What a server is responsible for, or has authority over is called zone.
If a server accepts responsibility for a domain and does not divide the domain into smaller domains, the domain and the zone refer to the same thing.
Server makes a database called a zone file and keeps all the information for every node under the domain.
If a sever has sub-domains, information about nodes in sub-domains are stored in servers at lower levels, with the original server keeping some sort of reference to these lower-level servers. But responsibility is still with the original server.
10McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
• Root Server: • Server whose zone consists of the whole
tree. It does not store any information about domains but delegates its authority to other servers.
• Keeps reference to other servers.
• There are 13 root servers.
• Primary server: A primary server loads all information from the disk file, for which it is an authority; Responsible for creating, maintaining, and updating the zone file.
• Secondary server loads all information from the primary server; Neither creates nor updates the zone files; create redundancy.
11McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 25.7 DNS in the Internet
Generic Domains Registered hosts according to their generic
behaviour. Each node in the tree defines a domain, which is an
index to the domain name space database. First level in the generic domain section allows seven
possible three-character labels.
13McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Table 25.1 Table 25.1 Generic Domain LabelsGeneric Domain Labels
Label Description
com Commercial organizations
edu Educational institutions
gov Government institutions
int International organizations
mil Military groups
net Network support centers
org Nonprofit organizations
14McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Table 25.2 Table 25.2 New generic domain labelsNew generic domain labels
Label Description
aero Airlines and aerospace companies
biz Businesses or firms (similar to com)
coop Cooperative business organizations
info Information service providers
museum Museums and other nonprofit organizations
name Personal names (individuals)
pro Professional individual organizations
15McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 25.9 Country domains
Country domain section follows the same format as the generic domains but uses two-character country abbreviations.
Second level labels can be organizational or more specific, national designations.
16McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 25.10 Inverse Domain
Inverse domain is used to map an address to a name. If a server requests a service from clients and the server has
a list of authorized clients [IP addresses], then it needs inverse mapping.
Inverse or pointer query. Hierarchical: Netid part is at higher level than the subnetid
part. 132.34.45.121 121.45.34.132.in-addr.arpa
17McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Resolution Mapping a name to an address or an address to
a name is called name-address resolution. Resolver
A host that needs to map an address to a name or a name to an address calls a DNS client named a resolver.
Resolver contacts the closest DNS server for mapping. If the server has the info, it replies; otherwise, it either
refers to the resolver to other servers or asks other servers to provide the information.
After the resolver receives the mapping, it interprets the response to see if it a real resolution or an error and finally delivers the result to the process that requested it.
18McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Mapping names to addresses 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. Mapping addresses to names
Client can send an IP address to a server to be mapped to a domain name.
DNS uses inverse domain. Recursive Resolution
Resolver can ask for a recursive answer from a name server Resolver expects the server to supply the final answer. If server is the authority, it checks its database and replies. If 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.
20McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Figure 25.12 Iterative resolution
If server is authority, it sends the answer. If server is not authority, it returns 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.
21McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
Caching
Reduction of search time would increase efficiency. DNS handles this with a mechanism called caching.
Response is stored in the server’s cache memory before sending it to the client.
If another client ask for the same mapping, the cache memory can be referred to give an answer.
Response is marked as Unauthoritative Caching speeds up resolution, but can provide an
outdated mapping. Time to live (TTL): time in seconds [provided by
authoritative server] for which the receiving server can cache the information.
DNS requires that each server keep a TTL counter for each mapping it caches.
22McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
DNS Messages
Two types of messages Query: header and question records Response: Header, question records, answer records,
authoritative records, and additional records. Header:
Query and response types have same format with some fields set to zero for the query messages.
12 bytes Identification: Match the response with query. Flags: Type of msg, type of answers requested, type of
desired resolution [recursive or iterative], … Number of question records Number of answer records: Zero in query Number of authoritative records: Zero in query Number of additional records: Zero in query
25McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
In DNS, when there is a change, such as adding a new host, removing a host, or changing an IP address, the change must be made to the DNS master file. Requires lot of manual updating.
DDNS [Dynamic DNS]: When a binding between a name and address is
determined, the information is sent, usually by DHCP to a primary DNS server.
Primary server updates the zone. Secondary servers are notified actively or passively.
Actively: Primary servers sends a message to secondary server about changes in the zone.
Passively: Secondary servers periodically check for any changes.
In either case, once notified about change, the secondary server requests for zone transfer.
26McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004
DNS can use the services of UDP or TCP, using the well-known port 53.
UDP: If response msg < 512 bytes If size is unknown If size increases, the server truncates the msg
and resolver now opens a TCP connection and repeats the request to get a full response from the server.
TCP: If response msg > 512 bytes Zone transfer