One of the most fundamental services on a TCP/IP network is name service. It is the service that translates hostnames into IP addresses. In Chapter 3, "Login Services," we configured telnet and ftp. Without name service, a user connecting to crow enters telnet 172.16.5.5
With name service, that same command is telnet crow
The result is the same. In either case, the user connects to the host at address 172.16.5.5. But most users prefer hostnames because they are easier to remember and easier to use. This is particularly true in the global Internet. It is possible to guess that http://www.sybex.com/ is a valid name, but there is no intuitive way to guess the address 126.96.36.199.
Linux systems use two techniques to convert hostnames to addresses: the host table and the Domain Name System (DNS). The /etc/hosts file is a table that maps names to addresses. It is a simple text file that is searched sequentially to match hostnames to IP addresses. The Domain Name System is a hierarchical, distributed database system with thousands of servers across the Internet, handling name and address queries. DNS is far more important than the host table for the operation of the Internet, but both services play a role. This chapter's discussion of name services begins with a quick look at the host table.
Was this article helpful?