• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Unable to change Hostname on Unbuntu 18.04 (CT)

Ravenworks

New Pleskian
Im trying to change the hostname of my VPS to the same hostname on Plesk which is using a sub-domain I setup under my own domain e.g. server.domain.co.nz

Im using OpenHost but they are really slow in their support and Ive been trying to communicate and solve this problem for 3 weeks. Meanwhile all my sites are going but the server is not secure as I cannot generate a Let's Encrypt certificate without this being solved. Therefore mail is not functioning properly either.

When in the OpenHost control panel I navigate to edit hostname it reads. A paragraph reads "The value can contain only letters, digits, hyphens and cannot start or end with a hyphen." This means I cannot enter in the FQDN as my hostname as it does not accept periods (.)

Is there another way to secure Plesk and Mail Server if you have this restriction? Or am I supposed to ignore all that and use the Console to change the server name. Sorry bit of a Newbie and it's frustrating when things do not go according to the documentation.

Kind regards
Andrea
 
When in the OpenHost control panel I navigate to edit hostname it reads. A paragraph reads "The value can contain only letters, digits, hyphens and cannot start or end with a hyphen." This means I cannot enter in the FQDN as my hostname as it does not accept periods (.)
Is your current FQDN hostname fully visible in the OpenHost control panel? The form entry might be just for the local part of the hostname (e.g. local.example.com, while only local is meant to be changed) or the missing (.) period could be an omission in the instructions.

There are two related settings that should be kept in mind here, the hostname and also the reverse DNS record for the hostname. Changing just the hostname will not be enough, the rDNS needs to be changed too and that is done by your provider. The OpenHost control panel might do this automatically when you change the hostname there, or their support needs to be contacted separately.

So, you could use the CLI to change the hostname (in the worst case, depending on the virtualization used and how they manage VPS'es, the hostname might revert on its own later), but the question of rDNS will remain.
 
Thanks for the great feedback. Im a little bit closer to getting this working!

Ive done what you have suggested (thanks to your excellent explanation) and changed the hostname to 'server' then I found another option to associate a domain with the server so I chose my domain name and now I have the server name 'server.domain.co.nz' YAY! YAY! YAY! So simple but OpenHost support did not mention anything about it!! Was very frustrating.

My FQDN hostname is not visible in OpenHost control panel. It is a sub-domain created in Plesk of a domain I own which is visible in the OpenHost control panel. So I will have to find out how to make the domain visible in the OpenHost control panel.

Add the hostname to the reverse DNS record which there is no option for in the OpenHost control Panel so will have to get the provider to do this. Would the reverse DNS record be my server name 'server.domain.co.nz' or my domain name 'domain.co.nz'?
 
The reverse DNS record would be 'server.domain.co.nz', so the FQDN hostname of your server.

If I understood correctly, setting the 'server' part and associating the correct domain with it in the OpenHost control panel caused a change of the hostname on your actual server? If not, refer to the How to change or get the server hostname on Plesk server article to do so, including changing the setting within Plesk. Both settings should be the same, within Plesk and on the OS level of the server.

What remains to be done is to check if your changes in the OpenHost control panel caused the rDNS to get updated. In the shell on you server execute:
Code:
dig -x <IP>
where <IP> is the actual IP of your VPS.

The answer section should contain something like:
<IP-in-reverse-order>.in-addr.arpa <SOA-in-seconds> IN PTR server.domain.co.nz.

BTW, the dig command is a part of bind-utils on CentOS and a part of dnsutils on Ubuntu and Debian.
 
Yes thats right. I associated domain with server then just put in the name 'server' and the hostname changed to server.domain.co.nz so your solution was right on the money. Server is now secured! Am I able to secure the Mail Server with the same certificate?

Checked the rDNS via your instructions and came back with the correct answer so must of updated itself. As for the domains Im hosting. They are all secured and websites going but mail is now the main issue.

I cannot create a sub-domain in my openhost dashboard the error says 'it already exists'. There is an A record in my domain ravenworks.co.nz which points to server.ravenworks.co.nz and Ive just added an MX record pointing to the server.ravenworks.co.nz just waiting for it to propagate to see if mail will work but think it may be better practice if I just tried to create the sub-domain and put all the dns needed in one place otherwise I will have to add the extra records for every domain I host.

Which is better practice?
 
Last edited:
For securing mail servers with a certificate, refer to: Securing Plesk and the Mail Server With SSL/TLS Certificates.

I'm not sure which would be a better practice per se, but I'll explain a bit about our setup and perhaps it will help you.

I'll simplify a bit and leave some things out, but basically: the main domain is hosted (e.g. example.com), each Plesk server gets just an A record (server1.example.com, server2.example.com, etc. etc.) in the DNS (those are the actual hostnames for the servers).

Each server needs one rDNS, that of a hostname.

Customers have MX records pointed to their respective mail.example-customer.com domains, not the the hostname of the server and not simply to their main example-customer.com domain, as customers can have separate web hosting and mail hosting.

Someone might ask why bother using separate MX records for each domain and (preferably) separate mail server addresses... well, because it greatly simplifies customer and server migrations, upgrades, etc. Hostnames change, customer domains do not. Thus customers do not need to reconfigure their email clients when the hostname changes for them.

The issue is only in regards to email SSL certificates, as Plesk currently only supports using a single certificate for the mail servers (and a single certificate for the control panel itself), so separate SMTP or IMAP certificate for each mail.example-customer.com aren't available.

For now, we either explain to our customers why are they getting a SSL certificate errors if they use mail.example-customer.com as an incoming or outgoing mail server (not a good practice, but...) or instruct them to use the hostname of the server in their IMAP and SMTP clients (this is avoided, but our default mail and control panel cert is valid for the hostname). But as far as MX records are concerned, using mail.example-customer.com (no manual creation of records is needed, the record is generated as each domain is added to Plesk), works fine.

You'll have to decide if the above works for you and possibly make adjustments...
 
Thanks all secured. I created a subscription for my server server.domain.co.nz and used that certificate to secure the mail server. Hopefully that will solve the issue of SSL errors on the mail client.

Im currently having DNS nightmares now as I can send mail via webmail but not received it and my mail client says 'unable to verify username and password' Is this all to do with the rDNS? Im receiving conflicting emails from support so very hard to troubleshoot myself so may have to get paid support to get the mail going.

Incidentally I migrated the server across successfully and Im presuming the DNS settings migrated across with each domain. Thanks for your help.
 
rDNS could affect your ability to receive mail, but would not cause issues with email client logins. DNS propagation can cause all kinds of troubles though, including both mentioned issues.
 
Hi Ales
Just to let you know mail was not working because of the server firewall. There are still alot of DNS records that I think the DNS Template added which do not really need to be there. And some I cannot get rid of which are the ns1 and ns2 records but I guess that does not really matter as long as it is going.
 
It's good to hear that you've got it sorted out!

The DNS template can be adjusted. If you're unsure about any of the records, I suggest opening a new thread about it and it can be discussed...
 
Back
Top