Jun 252008

Hostname is the name of the pc or laptop or even your system with which it is identified on a network. When you did the installation, you would have not specified the hostname or is assigned by a DHCP server but you would want to change it then here is the procedure.

In openSUSE, if you would like to do this from the Desktop.

1. Click Computer – YAST

YaST in Menu

2. Enter the root user password, if you are not an administrator on the system.

Hostnames in Network Services

3. Click Network Services in the left pane and click Hostnames.

Hostname Config Window

4. Select the IP Address Hostname line as in this screenshot and click Edit. Change the Hostname as required.

Enter the Hostname and IP Address

5. If you need to add a new Hostname, then click Add (instead of EDIT) and enter the IP Address and new hostname.

6. Click Finish.

This should change the hostname and resconfigure the Network Card. The effective change is that it change the hostname entry in the /etc/hosts file.

To manually edit the hostname without using the YAST control center then edit the /etc/hosts with your favorite Text editor

linux-4518:~ # vi /etc/hosts

and look for the line with the hostname that you want to change and change as required. If you want to add a new hostname the in a new line enter the IP Address and the hostname. Save the file.

Also, in Network Manager, there is a setting which overwrites the hostname it has onto the /etc/hosts file. Hence, it is important to either disable the option or to enter the right hostname in here as well.

To change,

1. Click Start Menu – Computer – YaST – Network Devices – Network Settings

2. Click Hostname/DNS tab and untick “Write hostname to /etc/hosts” or alternatively, enter the appropriate hostname in the box provided as shown in the screenshot below:

Network Manager hostname setting

This should help. The next time reboot the your system, the hostname should have changed.