Have you ever set the hostname on your Ubuntu installation only to want to change later? Here is an easy way to accomplish this and only requires changing a single line in a configuration file.
To begin, open the file /etc/hostname as root:
sudo gedit /etc/hostname
Change the text in that file to what you would like your new hostname to be and restart your computer. When the computer reboots, you will have a new hostname!