Change PMG hostname

Sep 20, 2024
27
3
3
Hello,

How can I change PMG's hostname? During the installation we accepted the default hostname pmg.mydomain.com, now we want to change it to mail.mydomain.com

I want to change the hostname for the whole system/server and not just PMG. I would appreciate any advice. Thanks.
 
There's the system hostname as in /etc/hostname and /etc/hosts.
Then there's the hostname as presented by postfix (myhostname) and that used in the URL for the spam quarantine. I think both those will get regenerated when you save the relevant parts in PMG web UI.
 
There's the system hostname as in /etc/hostname and /etc/hosts.
Then there's the hostname as presented by postfix (myhostname) and that used in the URL for the spam quarantine. I think both those will get regenerated when you save the relevant parts in PMG web UI.

I'm not sure where to make the change in PMG web UI, can you point me where it is?
 
If you edit the system hostname (/etc/hostname and /etc/hosts) you could then reapply the PMG templates (`pmgconfig sync --restart 1`). I think that should take care of most things e.g. postfix.
I run PMG in a PVE container, so I haven't needed to edit the hostname directly but rather through the PVE CT guest config. However, I think editing the hosts & hostname files should do it.
If the quarantine URL also needs updating, see 'Configuration->Spam Detector->Quarantine->Quarantine Host' in the web UI.
Having made changes, you could check for the existence of the old hostname by `grep -r <oldhostname> /etc`.
Hopefully that's it. I don't think changing the PMG hostname has quite the same implications as say changing a PVE node's.