Articles in this section

How to change or get the server hostname on Plesk server

kb: how-to Plesk for Linux

Applicable to:

  • Plesk for Linux
  • Plesk for Windows

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) that is registered on the internet and that you own. It can be a subdomain of a domain that you own as well. For example, the hostname structure server.example.com is often used for a such a purpose. Changes are not instant. It requires 24-48 hours to get a new hostname propagated through all the DNS servers.

Warning: Some server providers might deny hostname changes. In such cases you should contact them directly for further assistance.

Via Plesk GUI
  1. Log into 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.

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

    Note: if Plesk was previously configured to be accessed without a port number, set the new hostname as well in Tools & Settings > Customize Plesk URL> The specified domain or subdomain that resolves to the server IP address but is not used for hosting

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, a 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.

Was this article helpful?

Comments

1 comment
Date Votes

Please sign in to leave a comment.