How to Change Hostname in Ubuntu 14.04
1. Press Ctrl+Alt+T on keyboard to open the terminal. When it opens, run the below command:
hostname NEW_NAME_HERE
2. Press Ctrl+Alt+T on keyboard to open the terminal. When it opens, run the below command:
hostname NEW_NAME_HERE
For Ubuntu server without a GUI, run sudo vi /etc/hostname and sudo vi /etc/hosts and edit them one by one.
In both files, change the name to what you want and save them.
Finally, restart your computer to apply the changes.
Source: http://ubuntuhandbook.org/index.php/2014/04/change-hostname-ubuntu1404/