Online Book Reader

Home Category

Managing NFS and NIS, 2nd Edition - Mike Eisler [21]

By Root 453 0
getent for looking up database entries via the command line. For example:

% getent hosts frostback

128.0.0.1 frostback

getent can be thought of as one of the most primitive directory service clients, but nearly every application that deals with the network will be a client that needs to access the hosts database via the directory service. A more advanced client of the hosts database is a web browser such as Netscape Navigator or Internet Explorer. Browsers will link to gethostbyname or a similar interface to find the host addresses corresponding to Universal Resource Locators (URLs, those things that start with http:// ).

Going back to the telephone concept, sometimes we would like to know the name of the caller corresponding to a telephone number. In the United States, when you call a toll free number, the merchant receiving the call has the capability to display your phone number and can map it to your name (considering that the merchant is paying for your long distance call, some might reason that this is fair). In the computer networking world, it is sometimes useful to know the hostname of the client accessing the server. For example, suppose the server side of a web browser is a web server. Web servers often keep logs of the "hits" made to the server, for the purposes of understanding how popular a web site is, what is popular, and what hosts find it popular. The web server will always be able to find the host address of the client that made the hit. To figure out the name of the host, there is a programming interface called gethostbyaddr( ), which takes a host address, and returns the name of the host. The information can be obtained from the hosts database, via the directory service. In other words, both servers and client of different services, in this case, web services, can be clients of directory services.

Brief survey of common directory services

There are numerous different directory services. Here we will discuss some of the commonly used ones.

Directory Name Service (DNS)

The roots of DNS are in the early (pre-Web) days of the Internet. DNS was developed to provide hostname and address resolution. Before DNS existed, the authorities for the Internet maintained a global flat text file of the mappings from hostname to IP address in a file called hosts.txt, which was then made available for all the nodes on the Internet to download via a program called gettable. This is analogous to the telephone company giving you an updated telephone book periodically. Systems like Unix would convert the file into /etc/hosts.

This hosts.txt system worked fine for the Internet when it had only thousands of hosts. But when it reached tens of thousands of hosts, it wasn't practical, especially over the slow links available in the late 1980s. What was needed was a way to decentralize the process of looking up hostnames and addresses. The Internet was separated into domains, and each domain was left to identify its own authoritative server for hostnames and addresses within its domain. The only thing that needed to be maintained in a global database was the list of domain names, and the servers for that domain. Returning to the telephone directory analogy, when you live in one area code of the United States, and want to get directory information for another area code, you can prefix the area code to the number 555-1212 to get the appropriate directory service operator.

By assigning authority for a domain's directory information to each domain, DNS can be described as being hierarchical. Similarly, the United States telephone system assigns authority for a given area code's directory information to one pool of directory service operators that answer the 555-1212 number. DNS also lets domains within subdomains further delegate authority, and subdomains in turn. For example, in DNS there is a top-level domain called ".com" that assigns authority for administering sun.com and oreilly.com to DNS servers that the owners of sun.com and oreilly.com each designate. Within sun.com, there are several subdomains, such as

Return Main Page Previous Page Next Page

®Online Book Reader