3.2 Domain name system
Applications use easy-to-remember names for hosts on the Internet, but before sending any data to a host an application in the source host must translate its name for the destination host to the numerical network address.
The Internet is divided into domains, and an authority in each domain is responsible for allocating names. However, the domains may be divided into sub-domains and the responsibility of allocating sub-domain names may be delegated to other authorities. In this way the names form a tree structure as shown in Figure 13. The Internet Assigned Number Authority (IANA) has overall responsibility for assigning domain names on the Internet.
The full names of hosts are written as a sequence of words, separated by full stops, and each word refers to a domain or sub-domain. The names are written from left to right, with the most specific (the host) on the left and the top-level domain on the right. For example ‘tele.open.ac.uk’ is the full name of a host called ‘tele’ in the sub-domain ‘open’, which is itself within the larger sub-domain called ‘ac’ (for academic). The top-level domain for this host is ‘uk’, which is a geographical domain name. Broadly speaking, there are two classes of domain name – organisational and geographical. You can see from Figure 13 that some organisational names are the same as national names, illustrating the point that the individual domain names are not necessarily unique, but the full host names are. The delegation of naming authority greatly simplifies the allocation of names because the naming authorities in higher domains do not need to be notified about changes to names in the lower domains. However, naming authorities must be able to determine the physical location of hosts in their immediate sub-domain.
The network address determines the path through an internetwork, and the translation from a host name to a network address is typically done by the application invoking a library program called the resolver. In principle, the resolver program sends messages to a database which contains the network addresses corresponding to the domain names. It would not be practicable, however, to have a single database for the Internet, so distributed databases, called the domain name system (DNS), hold the translation information.
Each domain has one or more name servers and, whenever a host has a name to resolve, it sends the host name to a local name server. If the local name server has a record for the name it can reply immediately with the corresponding network address. If not, the local name server passes the query to a name server for a higher-level domain. In the worst case this would be a name server for the top-level domain as shown in Figure 14.
The top-level domain name server will at least know the name servers of all its immediate sub-domains, and can supply the local name server with the network address of a name server in the appropriate sub-domain. The local name server then repeats the query to this name server. The process is repeated until the query is satisfied.
Another method of resolving a host name is for the queried name servers to pass on the query directly to the next name server rather than passing the address of the next name server back to the local name server to continue the process.