NAME
hosts - host name database
SYNOPSIS
/etc/inet/hosts
/etc/hosts
DESCRIPTION
The hosts file is a local database that associates the names
of hosts with their Internet Protocol (IP) addresses. The
hosts file can be used in conjunction with, or instead of,
other hosts databases, including the Domain Name System
(DNS), the NIS hosts map and the NIS+ hosts table. Programs
use library interfaces to access information in the hosts
file.
The hosts file has one entry for each IP address of each
host. If a host has more than one IP address, it will have
one entry for each. The format of each line is:
IP-address official-host-name nicknames...
Items are separated by any number of SPACE and/or TAB char-
acters. The first item on a line is the host's IP address.
The second entry is the host's official name. Subsequent
entries on the same line are alternative names for the same
machine, or "nicknames." Nicknames are optional. A `#'
indicates the beginning of a comment; characters up to the
end of the line are not interpreted by routines that search
the file.
Network addresses are written in the conventional "decimal
dot" notation and interpreted using the inet_addr routine
from the Internet address manipulation library, inet(3N).
Host names may contain any printable character other than a
field delimiter, NEWLINE, or comment character. It is
recommended that host names not contain `.' (dot).
EXAMPLES
Here is a typical line from the hosts file:
192.9.1.20 gaia # John Smith
SEE ALSO
in.named(1M), gethostbyname(3N), inet(3N), nsswitch.conf(4)
resolv.conf(4),
NOTES
/etc/inet/hosts is the official SVR4 name of the hosts file.
The symbolic link /etc/hosts exists for BSD compatibility.