CentOS:
Logon to server via putty
Type      vi /etc/hosts      Enter
Press     I
Rename machine and Press escape press Shift colon
Type   wq!      Enter
Type   vi /etc/sysconfig/network   enter
Press i
Rename machine and Press
escape press Shift colon
Type   wq!     
Enter
service network
restart
chkconfig network on
If you want to reboot the server type    init
 6
*****************************   
Ubuntu:
sudo vim /etc/hostname
Press     I
Rename machine and Press escape press Shift colon
Type   wq!     
Enter
Sudo reboot
********************************************  
Comments