In order to change the hostname in Plesk (6+) you will need to make the change in the following locations below. This is needed if you want to change the hostname that is included on any emails sent from the plesk server.

  • /etc/hosts
    Your current hostname should be here behind the server’s IP address, change this to the new hostname
  • /etc/sysconfig/network
    You should have a HOSTNAME variable here, change this to your new hostname.
  • /var/qmail/control/me
    This contains the old hostname, change it to your new hostname to make qmail identify itself as the new hostname.
  • Change the servers hostname while it’s running, normally this is set at boot.
    hostname <newhostname>
  • Set the new hostname inside Plesk’s database:
    mysql -u admin -p`cat /etc/psa/.psa.shadow`
    use psa;
    update misc set val=’NEWHOSTNAME’ where param=’FullHostName’;

Now restart Plesk to activate your changes:
/etc/init.d/psa stopall
/etc/init.d/psa stop
/etc/init.d/psa start

After this, the server will now reply, you can test this by sending an email out or by sending an telnet out;

[root@vps2 ~]# telnet 10.25.2.1 25
Trying  10.25.2.125…
Connected to  10.25.2.1.
Escape character is ‘^]’.
220 Seemynamehaschanged.com ESMTP

Leave a Reply