Quote:
|
if you want to change the hostname on a cpanel server then
|
Use CPanel to manage cpanel and related materials. Don't make it more complicated than it has to be. WHM no longer gives you a 'license error'.
/etc/hosts is NOT a valid place to change a hostname, nor is it any sort of relevant place for your system's hostname to be changed. 2 places require changing, but NOT /etc/hosts
#1:
/etc/sysconfig/network needs to be updated
#2:
/proc/sys/kernel/hostname needs to be updated
Now, since you're using Cpanel, it's best to use CPanel to manage Cpanel's things (backups, etc), because otherwise it'll try to rewrite system files (ie: hostname)
This brings us to the question:
Well, that's answered in the man pages:
Quote:
|
This file is a simple text file that associates IP addresses with hostnames, one line per IP address. For each host a single line should be present with the following information:
|
In english (layman's terms):
/etc/hosts is a 'dns' of sorts. It doesn't rely on dns running, the resolvers running, or anything of the like. It is NOT used to control the system's hostname, though it CAN be used to
look up the system's hostname. You can add multiple ip host combinations in there and they will ALWAYS be available to the system, REGARDLESS of whether your dns is running or not
The files needed to edit the hostname are listed above, though, again, if you're using a control panel (CPanel), or even a VPS (virtuozzo, etc), you'll want to use THEIR setup to change and manipulate your hostname so that you can be sure it doesn't go right back where you don't want it to go