Configuring the /etc/hosts file

Before you begin

On each Content Gateway node, edit the /etc/hosts file to include—ON THE FIRST LINE—the IP address, fully qualified domain name, and hostname of the node.

Steps

  1. Log on to the Content Gateway host system as root.
  2. Edit /etc/hosts. A typical default /etc/hosts file looks like:
    127.0.0.1 localhost.localdomain localhost
  3. Open a new first line and specify the IP address, domain name, and hostname of the system. The format is:
    xxx.xxx.xxx.xxx [FQDN] [hostname]
    [FQDN] is the fully-qualified domain name of the machine, e.g. hostname.subdomain.top-level-domain.
    [hostname] is the system hostname.
    For example:
    10.10.10.10 wcg1.example.com wcg1
    127.0.0.1 localhost.localdomain localhost
    The IP address must be static and not served by DHCP. The proxy uses this IP address in features such as transparent authentication and hierarchical caching.
    Note: Do not delete the second line (former first line) that begins with 127.0.0.1. It specifies the loopback address and is also required.
  4. Save and close /etc/hosts.
    Repeat the above on every Content Gateway node.

Next steps

Confirming the settings:

To display the configured system hostname, on the Linux command line enter:

# hostname

To confirm the IP address that is bound to the hostname, on the Linux command line enter:

# ping hostname

For example:

# ping wcg1.example.com

This should return the IP address in line 1 of /etc/hosts. It should not return 127.0.0.1.

To test the local loopback address, on the Linux command line enter:

# ping localhost

This should return 127.0.0.1

To test if the hostname is resolved by DNS (if it is configured), on the Linux command line enter:

# nslookup hostname

For example:

# nslookup wcg1.example.com

This should return the same IP address as ping.

Note that in some cases it is optional to have the proxy in DNS.