Hi there.
Because I'm searching for a solution for the last 3 days, I'll share my solution here:
I'm using aaPanel within a Proxmox (5.x) LXC container.
Proxmox keeps an eye on the files hosts and hostname, normally you can't change them and
after each reboot, Proxmox writes "wrong" values into these files.
eg. your node is named with mail.domain.tld, Proxmox writes the follwoing into this files:
hosts:
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
# --- BEGIN PVE ---
151.xx.xx.97 mail.domain.tld mail
# --- END PVE ---
and hostname
mail
You can't change this files within the aaPanel-Terminal!
You can't use hostnamectl
Solution:
- within the Proxmox environment, start a terminal, login as root
- change both files to your need
hosts:
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
# --- BEGIN PVE ---
151.xx.xx.97 mail.domain.tld
# --- END PVE ---
and hostname
mail.domain.tld
place this two files in the directory /etc:
.pve-ignore.hostname
.pve-ignore.hosts
reboot the VM
I hope, this helps other