11.1. Introduction to DNS

11.1. Introduction to DNS

At first, a simple text file was used to store the database resolving symbolic domain names to their corresponding IP addresses. In Linux, this is the /etc/hosts file. When there were relatively few computers on the Internet, this method worked, even if it was somewhat cumbersome to maintain the central database and update local hosts files.

But as the number of computers on the Internet grew, so did the size of the database, until it became impossible for each location to maintain a copy of it. This is when the DNS came into being.

DNS is a distributed database of host names and their corresponding IP addresses; there are thousands of DNS servers on the Internet. The domain namespace has a hierarchical structure, with the root domain indicated by a . (dot, or period). The root domain is followed by subdomains, also separated with a period. The domains after the root are called top-level domains. Some of the top-level domain names are com, org, net, gov, edu, ru, and de. In cydsoft.com, cydsoft is a second-level domain name . Fig. 11.1 shows an example of the domain namespace hierarchy.

image from book
Figure 11.1: The domain namespace hierarchy

The advantages of DNS become apparent not only on the Internet but also in sufficiently large local networks. After DNS was implemented, another of its advantages came to light: The same IP address can be used for several sites. This allows several sites to be maintained on a single server.

IP address resolution parsing of a domain name is carried out from right to left. Suppose you have to resolve the IP address of the www.cydsoft.com host. A DNS client program on the user 's computer sends a request to a root server to specify, which DNS server services the com domain. Then, a query is sent to the com domain DNS server to find the cydsoft domain. If this domain is found, the address of the DNS server servicing the cydsoft domain is obtained. A query to resolve the www.cydsoft.com domain name to its IP address is then sent to this DNS server.

All these operations are performed transparently to the end user, so you will never see all these intricacies when entering an address into a browser. Depending on the browser, a message that the IP address is being looked up (Opera) or that the Web page is being connected to (Internet Explorer) is displayed in the browser's status line.

There also are numerous automatic DNS information-caching servers. Caching DNS information makes it possible not to query the main database all the time but to obtain the necessary address at the nearest server. Caching servers exchange information among themselves and allow any host name to be resolved to its address. Thus, your Internet provider may maintain its own DNS server. In this case, the request to resolve a host name to its IP address is sent to this DNS server. If this server does not have the requested host name information, the request is passed to another DNS server. The request is relayed among various DNS servers until the necessary host name information is encountered ; in this way, the IP address for the requested host name can be obtained from the nearest DNS server containing the necessary information in its cache.

DNS servers can not only look up IP addresses by host names but also perform reverse lookups, that is, resolve IP addresses to the corresponding host names. In this case, the IP address is also parsed from right to left. For example, to resolve IP address 190.1.15.77 to the host name, the address in the DNS request is entered as 77.15.1.190 with the .in-addr.arpa suffix added, resulting in this: 77.15.1.190.in-addr.arpa.



Hacker Linux Uncovered
Hacker Linux Uncovered
ISBN: 1931769508
EAN: 2147483647
Year: 2004
Pages: 141

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net