Server's hostname won't change!

jez9999

Well-Known Member
Jun 10, 2005
87
0
156
This is a weird one. I go into WHM, networking setup, and change the hostname to what I want it to be. I go into SSH and type 'hostname' - it's the new hostname. So far so good.

But whenever the machine reboots, it changes the hostname back to the old one!!!

I tried searching for similar problems and went through all the steps listed in this thread:
http://forums.cpanel.net/showthread.php?t=41686&highlight=hostname
... but still the same problem happens, upon reboot, the hostname is reset to what it was before. Something seems to be hardcoded into a cPanel setting somewhere. This seems like a bug in cPanel, and if we can work out what it is, it should be submitted to bugzilla.

Any ideas??
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
Are you using a VPS? If so, then that's controlled by the VPS software and you need to change it in whatever control panel you have for that or get your provider to fix it.

It's unlikely to have anything to do with cPanel and everything to do with the OS configuration.
 

jez9999

Well-Known Member
Jun 10, 2005
87
0
156
Well I am using a VPS, and the relevant control panel is VZPP. However I'd had a thorough look through it and although it displays the hostname, it seems to have no option to set the hostname; I'm presuming it's just somehow reading it from the OS by interfacing with the OS, just as it checks the root password.

If you think of Virtuozzo as the equivalent of a phyiscal machine (an analogy which I'm not sure is completely correct), what you're sort of saying is that to change the hostname on a normal server, you'd log in to the BIOS and change it there. But you wouldn't you'd change it in the OS. So surely you'd change a VPS's hostname in the OS, no?

The OS, BTW, is CentOS with WHM/cPanel running on it.
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
So surely you'd change a VPS's hostname in the OS, no?
No. As I said, you have to speak to your hosting provider regarding hostname changes.

VPS's are far from the equivalent of a real server, they just attempt to emulate one and under certain circumstances, not too well.
 

jez9999

Well-Known Member
Jun 10, 2005
87
0
156
But surely what determines the hostname of a machine is what the OS outputs when queried for the hostname. Could you explain to me how it is NOT the OS's decision what the machine's hostname is?
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
You need to ask such questions of Virtuozzo and your hosting provider (have you asked them yet?), as it is they who have developed their software to work that way.