• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

How do I change the hostname?

E

ergos

Guest
Hi all,
how can I change the hostname of my box from localhost.localdomain to something different?

Thanks in advance,
Filippo

(running plesk 8.0.1)
 
In your control panel, click on "Server" then "Server Preferences" - you'll see where you can change the hostname. What I normally do then is through SSH do:

#hostname new.host.name

This works for RedHat and CentOS.
 
Another side note, after you issue the shell command, your active console wont update by itself. Typically, the command "reset" will reset your SSH console, allowing any changes to show properly. (I.e. your new hostname will appear as NewHostname@~: instead of OldHostnaame@~:..

Just a bit of a quick fix, keeps from having to log back in and log back out...

-John
 
Using the hostname command doesn't make the change permanent (reboot and it's changed back). Also it doesn't update the configuration of qmail and some other apps (I believe).

Better change it through Plesk, as that also updates files like /etc/sysconfig/network (to make the change permanent after reboots, which you can do yourself as well, of course) and /var/qmail/control/me. Probably more...
 
Back
Top