/etc/hosts

hostname database

Name:

/etc/hosts

Description:

The hosts file contains information regarding the known hosts on the network. For each host, a single line should be present with the following information:

internet_address  official_host_name  aliases

Items are separated by any number of blanks or Tabs, or both. A pound sign (#) indicates the beginning of a comment - any characters after a #, up to the end of the line, aren't interpreted by routines that search the file.

If you're using a name server, this file provides a backup when the server isn't running. In this case, you should include only a few addresses in this file. These would include addresses for the local interfaces that ifconfig needs at boot time and a few machines on the local network.

Hostnames may contain any printable character other than a field delimiter, newline, or comment character.

See also:

gethostname(), ifconfig, named

DNS and BIND by Paul Albitz and Cricket Liu, O'Reilly & Associates (ISBN 1-56592-010-4)