Changing Hostname in Suse Linux

To Set the host name Temporarily:

hostname <SERVER_NAME>

The '-v' in this example means verbose. If the '-v' option is used, the output will look similar to what is below:

server1~# hostname -v computer2
Setting hostname to `computer2'

log out of the terminal and login the terminal again. Now you can see the changed hostname

However, with hostname command, it might not be a global change with in your Linux system.

To set the Hostname Permenantly in SuSe Linux Enterprise server: 

Edit /etc/HOSTNAME

# vi /etc/HOSTNAME  


# echo server2.mycompany > /etc/HOSTNAME

This will change hostname permenantly. Reboot the server and verify.


Open the YAST control center.


Navigate to Network Services --> DNS and Hostname.

The Hostname and Name Server Configuration window appears. 

Under the Hostname field, change the host name to a desired name and click the finish button.
Reboot the computer.

To View/check the server details, use the following commands:

  • hostname - will show or set the computer's host name
  • domainname - shows or sets the computer's NIS/YP domain name
  • dnsdomainname - shows the computer's DNS domain name
Your suggestions/comments are welcome on this.

Share this

Related Posts

Next Post »

What do you think about this Article? Add your Opinion..! EmoticonEmoticon