Handling the NIC Host Table — A Journey into the Past

An exception is Linux which eliminated a need for the etchosts file entirely. However, it is still recommended to maintain the file itself for a backward compatibility; Linux does not use the file etchosts, but still needs to get and keep host data somewhere; in Linux this is the file etcsysconfignetwork. Here is an example: cat etcsysconfignetwork NETWORKING=yes FORWARD_IPV4=false HOSTNAME=broome DOMAINNAME=scps.nyu.edu GATEWAY=128.122.71.65 Presented domain data is related to the NIS domain see Chapter 17 to learn about NIS; however, in this case DNS and NIS domain names match. 16.1.3.2 Aliases Aliases provide alternate host names, alternate spellings, and shorter host names. They are painless solutions for host name changes. They also fit well for such generic host names, as loghost, mailhost, lprhost, or dumphost. Some programs are written to direct their output to whichever host has been given a certain generic name. In this way, by assigning the appropriate generic host name as an alias, the output of such programs can be forwarded to any host on the network. For example, loghost is a special host name used by the syslog daemon, syslogd. Program syslog will direct its output to the host with the alias loghost; of course, in most cases this is the alias for the local host itself.

16.1.3.3 Maintaining the etchosts File

Today, the local host database the etchosts file is almost obsolete. In the past, however, one of the most basic and frequently performed administrators tasks was to maintain and update these data; it was crucial for proper network communication. The source host database provided by the NIC was, and still is, available, but before the data could be used they had to be transferred, selected, and stored appropriately, according to a very specific procedure.

16.1.3.3.1 Handling the NIC Host Table — A Journey into the Past

The Network Information Center NIC maintained a large table of Internet hosts called the NIC host table. The table was stored in the host nic.ddn.mil in the file netinfohosts.txt. Hosts included in the table are called registered hosts. Most of those host names are from the period when DNS was not yet implemented. Today the host table is changed only in special circumstances. The NIC host table is no longer used for online host name IP address mapping, but some useful information about the registered hosts can still be obtained. Sometimes, especially when creating local configuration files, some of that information is sorely missed. The NIC host table contains three types of entries: network records, gateways records, and host records. Each entry i.e., each record begins with a keyword that identifies the record type, followed 373 Figure 16.3: NIC netinfo hosts.txt records. The NIC netinfohosts.txt file can be retrieved interactively using FTP. However, on BSD systems the gettable command was specifically designed for this purpose. By using: gettable nic.ddn.mil The large NIC host table would be transferred to the local host; this should be put in a temporary working directory such as tmp. The htable command should be used to convert NIC host table records into UNIX−compliant entries. Three files are then created: hosts, networks, and gateways. The htable command looked for three other files localhosts, localnetworks, and localgateways, which should have been previously edited to include the local data. If some of those files are missing, the htable command will create an empty related file. If they exist, the NIC hosts.txt data were appended to local data. The created files are very large and contain thousands of lines, so their practical use is questionable. Finally, the newly created files should be moved to the etc directory and the transferred NIC hosts.txt file and temporary working directory deleted. The whole command sequence could be: cd tmp mkdir hostsdir Create the tmphostsdir directory. cd hostdir Make tmphostsdir the working directory. vi localhosts Create local data. vi localnetworks Create local data. The localgateways file can be ignored; the NIC hosts.txt file does not include data to update the etcgateways file. gettable nic.ddn.mil Transfer the NIC hosts.txt file. Connection to nic.ddn.mil Host table received Connection to nic.ddn.mil closed htable hosts.txt Make the hosts and networks files, and empty the gateways file. Warning, no localgateways file mv hosts etc Move to the etchosts file. mv networks etc Move to the etcnetworks file. rm −R tmphostsdir Delete the working directory tmphostsdir. Most of the previously discussed issues are no longer current. The gateway records are ignored, and the host records are not needed because today DNS provides host name information. Only the network records still provide some kind of useful information. The etcnetworks file is used to map 374 NIC produced the file netinfonetworks.txt, which includes only networks records, in order to make the procedure faster. This file should be transferred via anonymous ftp from nic.ddn.mil into a local working directory, and then the command htable networks.txt should be used. The created files hosts and gateways should be discarded, and the file networks moved to the etc directory. If you ever decide to implement this painful and unnecessary procedure to transfer related data, you will learn very quickly how beneficial DNS really is.

16.2 UNIX Name Service — BIND