Managing Systems and Workgroups: A Guide for HP-UX System Administrators
Configuring a Workgroup
Installing New Systems
Chapter 4 385
Configuring /etc/hosts
You can use any text editor to edit the /etc/hosts file. If you are not
running BIND or NIS, you can use SAM.
Step 1. If no /etc/hosts file exists on your system, copy
/usr/newconfig/etc/hosts to /etc/hosts, or use ftp to copy another
system’s/etc/hosts file to your system. See the ftp (1) manpage for
more information.
Step 2. Make sure the /etc/hosts file contains the following line:
127.0.0.1 localhost loopback
Step 3. Add your own host’s IP address, name, and aliases to the /etc/hosts
file, as in the following example:
15.nn.xx.103 wszx6 patrick
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. See the hosts (4) manpage.
Step 4. If the system has more than one network card, add a line to /etc/hosts
for each IP address. The entries for the additional cards should have the
same official host name but different aliases and different IP addresses.
Step 5. Add the names of any other hosts that you need to reach. If you will be
using a BIND or NIS server on a different host, add the name of that
host.
If your site uses DNS (Domain Name Service) or NIS (Network
Information Service), /etc/hosts acts as a backup resource in case the
name server goes down; so it is a good idea to add the names of systems
the local system frequently needs to reach.
Setting Network Information
If you do install HP-UX onto the system yourself, or do not provide
networking information during the installation, you can add this
information later by running /sbin/set_parms initial. The program
prompts you for the following information:
• host name and Internet protocol (IP) address.
• time zone