Changing Hostname in Suse Linux

By Parthiban Ponnusamy

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'
server1~#

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  

or

# echo server2.mycompany > /etc/HOSTNAME

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

CHANGING THE HOST NAME THROUGH YAST Tool

Open the YAST control center.

#yast

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.

For Further Reading,
Linux, Quick HOWTO

My Profile PhotoAbout the Author

I'm Parthiban, An UNIX System Admin by Profession. I'm Experienced in Linux/Unix System Administration and Scripting. I have done lot of work on the infrastructure Mgmt side in Linux, UNIX and Windows system administration, Hardware, Storage and Data center. I'm blogging since 2008.
Follow Me On Twitter or On Facebook

{ 0 comments... read them below or add one }

Post a Comment

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