If you like to change the hostname of your Linux VPS server or dedicated server you need a root access and SSH and command:
hostname host.domain.com
In case you are using some control panel like Plesk or cPanel you can change the server hostname easily inside the hosting control panel admin area.
There are problems sometimes if you are using cPanel as hosting control panel, and it will stop working if you change the linux server hostname. In this case you will need to resync the cPanel license with cPanel.net license server.
The following command should be run inside SSH as root:
/usr/local/cpanel/cpkeyclt