• Inviting everyone who uses WordPress management tools in Plesk
    The Plesk team is conducting a 60-minute research session that includes an interview and a moderated usability test.
    To participate, please use this link .
    Your experience will help shape product decisions and ensure the tools better support real-world use cases.

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