First edit the hostname file by typing:
sudo vi /etc/hostname
Delete the line that you see in the file so it our case we deleted:
Now enter your hostname, in our case we called it darrens centos.
We then typed
to write and save the file.
We then restart the machine by typing
sudo init 6
When the machine has re-booted type in
to see the new hostname.
A video tutorial can be found here: