• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue Change "hostname" in Plesk Obsidian does not work correctly

Jürgen_T

Regular Pleskian
(My v-serer: Plesk Obsidian 18.0.34 Update #2, Ubuntu 18.04.5 LTS)

When I change the hostname in Plesk/Tools&Settings/server settings then the files etc/hostname, etc/mailname and etc/postfix/main.cf become changed to the new hostname (as expected).

But the "helo" in E-Mails managed by postfix uses the old hostname.

Connecting to the server via ssh shows the old hostname as prompt in the bash i.e. root@{old hostname}:~# and not root@{new hostname}:~#
In addition the command root@{old hostname}:~#hostname brings up the old hostname, too.

However the command hostname -b

root@{old hostname}:~#hostname - b {new hostname} solves this problem.

After doing this the command root@{old hostname}:~#hostname now shows the new hostname, also the transmitted helo by postfix is correct and in a new ssh-session the prompt becomes: root@{new hostname}:~#, too.

However, this solution only works until a reboot of the server and I have to set hostname -b [new hostname} again. Any idea how to set a new hostname permanent?
 
Thank you for the quick reply! Plesk did not change the file etc/hosts to the new hostname so I did it manually
 
It is correct that Plesk does not change that file, because that is a basic operating system component.

Were you able to solve the issue by changing it manually? At least now after a reboot the server should know its new name.
 
Yes, currently Plesk and my server work fine. The new content of hosts is (hiding some figures with XXX):

# Auto-generated hostname. Please do not remove this comment
127.0.0.1 mail.XXX.de mail localhost.localdomain localhost
81.169.231.XXX mail.XXX.de mail

But after reboot the old content of hosts appears again. By the way are the entries ok I made in this file?
 
I have tried to investigate this issue further. After changing in Plesk <Old Hostname> to <New Hostname> and rebooting the <Old Hostname> appears again as prompt in the bash (PuTTY, ssh) and also in the header of E-Mails.

As far as Plesk is concerned everything seems to work:
etc/mailname => <New Hostname>
etc/hosts => ...<New Hostname>...
etc/hostname => <New Hostname>

But the following commands via ssh/PuTTY show:
Result of :~#hostname => <Old Hostname>
Result of :~#hostname -A => <New Hostname> <New Hostname> <Old Hostname> <Old Hostname>
Result of :~#grep -lr <Old Hostname> /etc/* => /etc/sasldb2


Now manually changing the current Hostname with :~#hostname -b <New Hostname> corrects the problem and leads to
Result of :~#hostname => <New Hostname>
Result of :~#hostname -A => <New Hostname> <New Hostname> <New Hostname> <New Hostname>

So, now everything works fine but just until the next reboot:-(

So as a quick solution to set <New Hostname> permanent I am now using a cronjob with @Reboot and the command root hostname -b <New Hostname>

This works in my case but it is not satisfying as I do not really understand where Plesk does not make the necassary additional changes.
 
Back
Top