How to change hostname in ubuntu
Changing the hostname or computer name in ubuntu
Edit /etc/hostname and change to the new value,
Edit /etc/hosts and change the old 127.0.1.1 line to your new hostname
127.0.1.1 ubuntu.local ubuntu # change to your new hostname
Now after a reboot, your hostname will be the new one you choose.