Set hostname

To set the hostname in Red Hat / CentOS 5:
vi /etc/sysconfig/network #change it here
echo server1.example.com > /etc/hostname #and here
hostname server1.example.com #and here for good measure
/sbin/service network restart #restart the network