hosts(SFF)


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(ADMN)) 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
is 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(SFF)), 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
is the node name of the host. This is the same as the output obtained when executing

uname -n

on the host (for example, grinch). Placement of a fully qualified domain name (for example, grinch.eng.xyz.com) in this field may cause some TCP/IP utilities to behave other than expected when dependent on this information.


aliases
is a list of alternate names for the host. Aliases can be used in network commands in place of the node name. It is suggested that you specify the fully qualified domain name for a host (for example, grinch.eng.xyz.com) as one of the aliases.
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.

Examples

#	Engineering network
128.212.64.1    morannon   morannon.eng.xyz.com
128.212.64.2    grinch     grinch.eng.xyz.com
128.212.64.85   ozzy	   ozzy.eng.xyz.com

Files

/etc/hosts

See also

inet(ADMP), networks(SFF), uname(C)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005