HP-UX Internet Services Administrator's Guide (May 2010)

NOTE: If you choose to use BIND 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 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 HP System
Management Homepage (HP SMH).
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 than one 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.
5. Add any other hosts to the /etc/hosts file that you need to reach. If you use a
BIND or NIS server on a different host, add that host to your /etc/hosts file.
If you have no default gateway configured, and you add a host that is not on your
subnet, SAM will prompt you for the gateway. To stop the prompting, configure
a default gateway.
6. If you are not using SAM, you must configure a gateway for each host that is not
on your subnet. See “Configuring a Route” (page 29).
7. Make sure the /etc/hosts file is owned by user root and group other, and
make sure the permissions are set to 0444 (-r--r--r--).
Configuring a Route
To configure a route from your system to other networks, complete the following steps:
Configuring the Internet Services Software 29