I'm trying to change the hostname on my fresh CentOS 6.5 image (VPS) via SSH. The sources I've found all say the hostname can be permanently changed in /etc/sysconfig/network
and /etc/hosts
, and that the current hostname can be checked using the hostname
command. The problem, however, is that the hostname
command doesn't return anything shown in either of the two aforementioned files. For clarity, in the following commands the following information has been substituted: username
(obvious), curHN
is what is currently reported after the @
sign in my SSH prompt, provider.com
is my VPS provider's website.
What would be the correct way of changing the hostname on this setup?
[username@curHN ~]$ hostname
curHN.provider.com
[username@curHN ~]$ cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain
[username@curHN ~]$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6