There are only a couple of steps:
sudo vi /etc/hosts
You dont have to use vi you can open it with any text editor
Here you should see your current hostname, change it to the one you want.
sudo vi /etc/hostname
Here you should see not the hostname you just entered into /etc/hosts but the old one.
Change it to your new one.
Restart the hostname service
sudo service hostname restart
sudo /etc/init.d/hostname restart