|
Edit the /etc/sysconfig/network file
By editting this file you can change the HOSTNAME field to the new hostname. Simply use vi to edit the file. These changes will only take effect upon the computer reboot.
Note: On the older versions of Linux, you can change the hostname by editting the /etc/HOSTNAME file.
Another way you can do by Set the hostname using the hostname command Execute the hostname command with the new hostname as the first parameter. For example:
[root@hostname root]# hostname newhostname
This will then change the hostname immediately. However, it will not remeber the changes upon a reboot. Also, it will not change the command prompt to refresh the new hostname. To refresh the prompt, simply logout of the current session and log back in.
|