Domain Name System (DNS)

51
Domain Name System (DNS) Ch25 Ameera Almasoud Ameera Almasoud 1 Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

description

Domain Name System (DNS). Ch25 Ameera Almasoud. Introduction. There are several applications in the application layer of the Internet model that follow the client/server paradigm. The client/server programs can be divided into two categories: - PowerPoint PPT Presentation

Transcript of Domain Name System (DNS)

Stream Control Transmission Protocol (SCTP)

Domain Name System(DNS)Ch25Ameera Almasoud

Ameera Almasoud1Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007IntroductionThere are several applications in the application layer of the Internet model that follow the client/server paradigm. The client/server programs can be divided into two categories:Application that directly used by the user, such as e-mail, Application that support other application programs. The Domain Name System (DNS) is a supporting program that is used by other programs such as e-mail.Ameera Almasoud2Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007Example of using the DNS serviceAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 20073

Host FileWhen the Internet was small, mapping was done by using a host file. The host file had only two columns: name and address.Every host could store the host file on its disk and update it periodically from a master host file. When a program or a user wanted to map a name to an address, the host consulted the host file and found the mapping.it is impossible to have one single host file to relate every address with a name.The host file would be too large to store in every host. it would be impossible to update all the host files every time there was a change.

Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 20074Host FileOne solution would be to store the entire host file in a single computer and allow access to this centralized information to every computer that needs mapping. But this would create a huge amount of traffic on the Internet.The solution is to divide this huge amount of information into smaller parts and store each part on a different computer. the host that needs mapping can contact the closest computer holding the needed information.This method is used by the Domain Name System (DNS).Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 20075NAME SPACETo be unambiguous, the names assigned to machines must be carefully selected from a name space with complete control over the binding between the names and IP addresses.

Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 20076The name is an unstructured sequence of characters.Disadvantage: it must be centrally controlled to avoid duplication.Therefore, it can not be used in large systems such as the Internet.Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 20077NAME SPACEFlat Narne SpaceThe name is structured and consists of many 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. The authority to assign and control the name spaces can be decentralized. A central authority can assign the part of the name that defines the nature of the organization and the name of the organization.The responsibility of the rest of the name can be given to the organization itself. Ex: suffixes /prefixesit is efficiently used in large systems such as the Internet.Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 20078NAME SPACEHierarchical Narne Space8DOMAIN NAME SPACETo 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 the top. The tree can have only 128 levels: level 0 (root) to level 127.

Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 20079Domain name spaceAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200710

Each node in the tree has a labelThe label is a string of maximum length of 63 charactersChildren of a node should have different labelsThe label of the root is a null stringAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200711DOMAIN NAME SPACE LabelEach node in the tree has a domain name. A full domain name is a sequence of labels separated by dots (.). The domain names are always read from the node up to the root.The last label is the label of the root (null).Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200712DOMAIN NAME SPACE Domain NameDomain names and labelsAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200713

Fully Qualified Domain Name(FQDN). :If a label is terminated by a null string.It contains all labels, from the most specific to the most general, that uniquely define the name of the host. Ex: challenger.ate.tbda.edu.

Partially Qualified Domain Name(PQDN) :If a label is not terminated by a null string.name A PQDN starts from a node, but it does not reach the root.It is used when the name to be resolved belongs to the same site as the client.Ex: challengerAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200714DOMAIN NAME SPACE Domain NameFQDN and PQDNAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200715

A domain is a subtree of the domain name space. The name of the domain is the domain name of the node at the top of the subtree.

Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200716DOMAIN NAME SPACE DomainAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200717

DOMAIN NAME SPACE DomainDISTRIBUTION OF NAME SPACE

The information contained in the domain name space must be stored. However, it is very inefficient and also unreliable to have just one computer store such a huge amount of information. In this section, we discuss the distribution of the domain name space.

Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200718The solution to these problems is to distribute the information among many computers called DNS servers. we let the root stand alone and create as many domains (subtrees) as there are first-level nodes. #DNS allows domains to be divided further into smaller domains(subdomains).It is inefficient and unreliable to store the information of the domain name space on a single computer:It is inefficient because responding to all requests from one computer imposes a heavy load on the systemIt is unreliable because a failure in the computer makes all data inaccessibleAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200719DISTRIBUTION OF NAME SPACEHierarchy of Name ServersHierarchy of name serversAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200720

Since the complete domain name hierarchy cannot be stored on a single server, it is divided among many servers. What a server is responsible for or has authority over is called a zone. We can define a zone as a contiguous part of the entire tree.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. The server makes a database called a zone file and keeps all the information for every node under that domain.Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200721DISTRIBUTION OF NAME SPACE ZoneZones and domainsAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200722

A root server is a server whose zone consists of the whole tree. A root server usually does not store any information about domains but delegates its authority to other servers. There are several root servers, each covering the whole domain name space. The servers are distributed all around the world.Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200723DISTRIBUTION OF NAME SPACE Root ServerA primary server stores a file about the zone for which it is an authority on its local diskA primary server is responsible for creating, maintaining, and updating the zone fileA secondary server downloads information from another server (primary or secondary) on its local disk: this is called zone transferA secondary server is NOT responsible for creating, maintaining or updating the zone file

Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200724DISTRIBUTION OF NAME SPACE Primary and Secondary ServersIf updating is required, it is performed by the primary server, then sent to the secondary serverThe aim of assigning a secondary server is to create data redundancy so that it can serve clients in case of failure of the primary serverA server can be primary for a zone and secondary for another server; therefore, it is important to state the zone to which a primary/secondary server refers

Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200725DISTRIBUTION OF NAME SPACE Primary and Secondary ServersDNS IN THE INTERNETDNS is a protocol that can be used in different platforms. In the Internet, the domain name space (tree) is divided into three different sections: generic domains country domains the inverse domainAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200726DNS IN THE INTERNETAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200727

Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200728DNS IN THE INTERNETGeneric domains

Generic domain labelsAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200729

These use two-character country abbreviationsExamples are: sa (Saudi Arabia)eg (Egypt)uk (UnitedKingdom) fr (France) us (United States), etcAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200730DNS IN THE INTERNET Country DomainsAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200731

DNS IN THE INTERNET Country DomainsThese are used to map an IP address to a nameWhen a server receives a request, the first thing it performs is to check if the sending client is an authorized one:The resolver sends a query to the DNS server with the client nameThe DNS server finds the corresponding IP addressThe extracted IP address is resent back to the resolver, then to the serverThe server checks if the received IP is on the list of its authorized clientsAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200732DNS IN THE INTERNET Inverse DomainsThis type of query is called inverse query or pointer queryThe first and second node in a pointer query are always arpa and in-addrThe DNS servers that handle the pointer query are hierarchical:The highest level is the network id (netid) partThe lower level is the subnet id partThe lowest level is the host id partAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200733DNS IN THE INTERNET Inverse DomainsIP= netid.hostid 132.34.45.121 Class B

Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200734

DNS IN THE INTERNET Inverse DomainsRESOLUTIONMapping a name to an address or an address to a name is called name-address resolution.Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200735Client/server application that resides on DNS clientsAny host that requires to map an IP address to a URL name or vice versa calls a resolverThe resolver accesses the closest DNS server with the mapping requestIf the server has the required information, it provides them to the resolverIf the server does not have the required information, it acts in one of the following ways:The server refers the resolver to another DNS server.The server asks another server for the required information, and provides it to the resolver.Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200736RESOLUTION ResolverMost of the time, the resolver gives a domain name to the server and asks for the corresponding address.Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200737RESOLUTION Mapping Names to AddressesA client can send an IP address to a server to be mapped to a domain name.Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200738RESOLUTION Mapping Addresses to NamesAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200739RESOLUTION Recursive Resolution

When a resolver sends a mapping request to a name server, it expects the answer from the same serverIf the server is the authority for the domain name, it responds immediately to the resolverOtherwise, the server sends the mapping request to the parent serverThis procedure is repeated recursively until an answer is foundThe answer follows the same way back through the servers until it reaches the resolverAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200740RESOLUTION Recursive ResolutionAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200741

RESOLUTION Iterative ResolutionIf 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. Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200742RESOLUTION Iterative ResolutionThis is a mechanism that aims to reduce the search time a DNS server needs to look for a name (or address) in its database.Therefore, when a new request arrives to the server, it checks its cache first.If the required information are stored in the cache, the server responds to the request immediatelyIf not, it sends the request to another server as explained beforeWhen a server asks another server for the information, it stores it in its cache memory before sending it to the clientIn case the required information is found in the cache, theserver marks the response as unauthoritative. Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200743RESOLUTION CachingTime-to-Live (TTL) counter, in seconds, is used to overcome this problemThe server keeps a TTL with each entry in its cacheWhen TTL reaches zero, the corresponding entry is marked InvalidWhen a request is made to an invalid entry, the server considers it missing, and a request is sent to the authoritative server.If a server caches a mapping for a long time, it may send an outdated mapping to the clientAnother technique is to search the cache periodically and purge (kill) all entries with expired TTL.Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200744RESOLUTION CachingDNS MESSAGESDNS 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.

Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200745Query and response messagesAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200746

Header formatAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200747

TYPES OF RECORDSThere are 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.

Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200748REGISTRARSHow are new domains added to DNS?New domains are added to the Internet through registrarsA registrar verifies that the requested domain name is unique, then enters it into the DNS database for a fee.

Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200749DYNAMIC DOMAIN NAME SYSTEM (DDNS)Changes made in the domain include adding a new host,removing a host, or changing the IP address of a hostIn DNS, any made change should be reflected in the DNS master fileIn a huge environment such as the Internet, such updates in the DNS master file should be automatically reflectedWhen a change is made, the information is sent to the primary DNS server which, in turn, updates the zonePrimary servers may update secondary servers actively.Another mechanism, the secondary servers check periodically for any updates in the primary server: this is called passive updateAmeera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200750ENCAPSULATIONDNS may use either UDP or TCPUDP 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.In both cases, the well-know port number of the server is 53Ameera AlmasoudBased on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 200751