Plesk

 How to change or get the server hostname on Plesk server

Question

How to change or get a server hostname on the Plesk server?

Answer

Note: A server hostname must be a fully qualified domain name (FQDN). Changes are not instant. It requires 24-48 hours to get a new hostname propagated through all the DNS servers.

Warning: Server providers might deny hostname change, in such cases contact the server provider.

In Plesk interface

  1. Login to Plesk.

  2. Go to the menu Tools & Settings > Server Settings, specify the new hostname in the field Full hostname and click OK at the bottom of the page to apply the changes**:**

    Note: You should be logged in as the Plesk administrator to be able to see or change the hostname.

  1. Apply SSL certificate to Plesk (if it is needed) as instructed in the article How to secure a Plesk hostname.

Via CLI (Linux only)

  1. Connect to the server using SSH as root.

  2. To view hostname, execute the command:

    # hostname

  3. To change server hostname, execute the following command with preferred hostname value instead of host.example.com:

    # plesk bin server_pref --update -hostname host.example.com

    Alternatively, the native SystemD utility(CentOS7/Debian8+/Ubuntu16) can be used:

    # hostnamectl set-hostname host.example.com

  4. Restart services sw-cp-server and sw-engine:

    # service sw-cp-server restart
    # service sw-engine restart

  5. If it is needed, apply SSL certificate to Plesk

Note: In some cases, server restart is required.
For Google Cloud instance the changes will not be saved after server restart. Use the following workaround: https://cloud.google.com/compute/docs/instances/custom-hostname-vm.

Exit mobile version