Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX System Administrator's Guide: Configuration Management: HP-UX 11i Version 3 > Chapter 2 Configuring System Parameters

Configuring /etc/hosts

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

You can use any text editor to edit the /etc/hosts file. If you are not running BIND, you can use HP SMH.

  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.

  2. Make sure the /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.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.

  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.

  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 that the local system frequently needs to reach.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2008 Hewlett-Packard Development Company, L.P.