Changing System Name

 

 Changing the System Name

The name of the system is stored in several places. If you want to change the name of your system, you must change the name in all the following locations, or your system does not function correctly:

  • In the file /etc/sys_id
  • In the file /etc/hosts (for networking purposes)
  • In a kernel data structure, which you read and set with hostname
  • In an NIS map on the NIS master server, if you are running NIS
Note: Do not arbitrarily change the name of a running workstation. Many programs that are started at boot time depend on the name of the workstation.

To display the name of the system, use the hostname command with no arguments:

hostname

This displays the name of the system. The uname command also displays the name of the system, along with other information.

To change the name of the workstation, follow these steps:

1. Log in as root.

2. Edit the file /etc/sys_id. Change the name of the host to the new name. Write and exit the editor.

3. You must also change the name of the host in any network files, such as /etc/hosts, and possibly in the NIS map on the master NIS server.

4. Reboot your system.

All programs that read the hostname when they are started at boot time now use the correct hostname.

 

Comments