Edit the Host File and Set the Hostname

To edit the host file and set the hostname, perform the following steps:

Edit the Host File

  1. Using a text editor, open the host's file on every host in your cluster.

For example: vi /etc/hosts

  1. Add a line for each host in your cluster. The line must consist of the IP address and the FQDN.

For example:

Bash
Copy

Do not remove the following two lines from your host file. Removing or editing the following lines may cause various programs that require network functionality to fail.

Bash
Copy

Set the Hostname

  1. Confirm that the hostname is set by running the hostname -f command.

This must return the <fully.qualified.domain.name> you just set.

  1. To set the hostname on each host in your cluster, use the following command:
Bash
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
  Last updated