The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 07-04-2002
killerserv's Avatar
killerserv killerserv is offline
Unix Predator
 

Join Date: Dec 2000
Location: Phoenix, AZ
Posts: 670
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.