Changing the hostname of your Ubuntu server
The first step is to logon to your server with your usual account. Then you can run the following commands...
$ sudo vi /etc/hostname
Using vi, edit the hostname file with your new hostname, and save your results.
Finally you need to restart your server...
$ sudo shutdown -r now
Your server now has a new hostname.
Thanks for visiting.