hosts(4tcp)


hosts -- list of hosts on network

Description

The file /etc/hosts is a list of hosts that share the network, including the local host. It is referred to by programs that need to translate between host names and Internet addresses when the name server (see named(1Mtcp)) is not being used. Each line in the file describes a single host on the network and consists of three fields separated by any number of blanks or tabs:

address name aliases ...

where


address
The Internet address. Unless another type of address is required by some host on the network, address should be a Class A address, which takes the form net.node where net is the network number from /etc/networks (see networks(4tcp)), which must be between 0 and 127; and node is a value which must be unique for each host and be between 0 and 16777215.

name
The fully qualified domain name of the host (for example, grinch.eng.xyz.com).

aliases
A list of alternate names for the host (such as the unqualified node name). Aliases can be used in network commands in place of the node name.
The routines which search this file ignore comments (portions of lines beginning with ``#'') and blank lines.

Internet addresses can actually take one of four forms:


A
A is a simple 32-bit integer.

A.B
A is an eight-bit quantity occupying the high-order byte and B is a 24-bit quantity occupying the remaining bytes. This form is suitable for a Class A address of the form net.node.

A.B.C
A is an eight-bit quantity occupying the high-order byte; B is an eight-bit quantity occupying the next byte; and C is a 16-bit quantity occupying the remaining bytes. This form is suitable for a Class B address of the form 128.net.node.

A.B.C.D
The four parts each occupy a byte in the address.

Files

/etc/hosts

References

inet(7tcp), networks(4tcp)

Examples

127.0.0.1	localhost
# Engineering network
192.16.64.1    morannon.eng.xyz.com morannon host1
192.16.64.2    grinch.eng.xyz.com grinch host2
192.16.64.85   ozzy.eng.xyz.com ozzy host85

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004