Change hostname or server name of a Linux system. Learn following step by step tips to do it yourself.
To change the hostname on your actual VPS, you need to login via SSH (see: https://www.vpsblocks.com.au/support/Knowledgebase/Article/View/41/0/how-do-i-use-ssh)
Ubuntu
Type: /bin/hostname mynewhostname
Type: nano /etc/hosts
Edit the file and then save it.
* Note: If you do not have nano installed, you can install it by running:apt-get install nano
CentOS
Type: hostname mynewhostname
Type: pico /etc/sysconfig/network
Edit the file by changing the hostname entry if there is one, and then save it.
* Note: If you do not have pico installed, you can install it by running:yum install pico
CentOS 7
Type: pico /etc/hostname
Edit the file by changing the hostname entry and then save it.
Type: pico /etc/hosts
Edit the file by changing the hostname entry for 127.0.0.1 and then save it.