HP-UX Internet Services Administrator's Guide (August 2003)
Installing and Configuring Internet Services
Configuring the Internet Services Software
Chapter 2 31
Alternatively, you can use the /etc/hosts file as your primary name
service. Each host in your network needs a copy of the /etc/hosts file
containing the names and addresses of all the other hosts in your
network. For information on the /etc/hosts file, see “Editing the
/etc/hosts File” on page 31.
NOTE If you choose to use BIND, NIS, or NIS+ as your primary name service,
you still need to configure a minimal /etc/hosts file so that your host
can boot if BIND, NIS, or NIS+ is not available.
Editing the /etc/hosts File
You can use any text editor to edit the /etc/hosts file, or you can use
the System Administration Manager (SAM). SAM is HP’s
windows-based user interface for performing system administration
tasks. To run SAM, type sam at the HP-UX prompt. SAM has an
extensive online help facility.
Follow these steps to edit the /etc/hosts file:
1. If no /etc/hosts file exists on your host, copy
/usr/newconfig/etc/hosts to /etc/hosts, or use ftp to copy the
/etc/hosts file to your host from another host on your network.
Type man 1 ftp at the HP-UX prompt for more information.
2. Make sure your /etc/hosts file contains the following line:
127.0.0.1 localhost loopback
3. Add your own host’s IP address, name, and aliases to the
/etc/hosts file, as in the following example:
15.13.131.213 hpindlpk romney
The first field is the IP address, the second is the official host name
(as returned by the hostname command), and any remaining fields
are aliases. Type man 4 hosts at the HP-UX prompt for more
information.
4. If your host has more thanone network interface installed, add a line
to /etc/hosts for each interface. The /etc/hosts entries for your
host will have the same official host name but different aliases and
different IP addresses.