Thursday, February 10, 2011

Tips to change Hostname in Linux

Before you try your hand at changing your Linux hostname, it is advisable that you check the present hostname on Linux operating system. The commands that you use for checking the hostname are ‘uname -n’ or ‘hostname’; these commands will give you the operating system’s current hostname.


Let’s get started to change the hostname. Suppose you want the hostname to be NEW_HOSTNAME, you need to type in the command ‘hostname NEW_HOSTNAME’. After doing this, you may find that after rebooting your system the old hostname is being displayed, instead of the new hostname. This happens owing to the fact that the hostname gets selected from a particular system configuration file.

Type ‘init 6’ at the command prompt and again check the hostname by using the hostname command. For changing the hostname to NEW_HOSTNAME permanently so that it shows even after you reboot your system, you have to make some changes in the ‘/etc/sysconfig/network’ file. Just type in ‘vi /etc/sysconfig/network’ at the terminal. You will get some options that will allow you to change the hostname. Set the hostname in the /etc/hosts file manually.

Now check the hostname to find out if it has been changed to the new one, by restarting the network and rebooting your system. These tips should help you in changing the hostname in Linux, but in case you are having problems, you can call a remote computer support provider. People in Houston often face problems in changing hostname in Linux and look for companies that offer tech support for computer repair in Houston. This article should be informative for them.

No comments:

Post a Comment