We can change the hostname of a machine by several ways. I am mentioning one way to change the hostname of Ubuntu server.
- Open the terminal or Login with putty.exe as root user (if you are working remotely)
- Goto /etc/
- Type nano hostname
- Change the HOSTNAME to your preferred machine name
- Press Cntrl+X
- Save the configuration by pressing Y
- Log off or reboot
Note: Add the new hostname and ipaddress in the /etc/hosts file also