My Ubuntu 20.04LTS containers are losing the domain part from the hostname when the container is (re) started.
The impacted system (currently a 2-node cluster, 3rd node to be added) is running Proxmox 6.1-7 and was provisioned a few days ago. This has several Ubuntu 20.04LTS containers and VMs. The VMs are not affected. The LXC template was downloaded from the default pveam list. I need the domain part included in the hostname to keep my monitoring system happy.
I also have 2 other Proxmox clusters (also 6.1-7) running a variety of VMs and containers - including Ubuntu 18.04LTS, but not 20.04LTS. These do not display the same issue.
In Proxmox, Options->hostname contains myname.mydomain
I have tried:
The impacted system (currently a 2-node cluster, 3rd node to be added) is running Proxmox 6.1-7 and was provisioned a few days ago. This has several Ubuntu 20.04LTS containers and VMs. The VMs are not affected. The LXC template was downloaded from the default pveam list. I need the domain part included in the hostname to keep my monitoring system happy.
I also have 2 other Proxmox clusters (also 6.1-7) running a variety of VMs and containers - including Ubuntu 18.04LTS, but not 20.04LTS. These do not display the same issue.
In Proxmox, Options->hostname contains myname.mydomain
I have tried:
- chmod a-w /etc/hostname (+reboot)
- Removed "myname" entry in /etc/hosts file (leaving "myname.mydomain") (+reboot)
- root@myhost:/etc# chattr +i hostname
chattr: Operation not permitted while setting flags on hostname - set "kernel.domainname = myname.mydomain" in /etc/sysctl.conf (+reboot)
- Set "Domains=bip" in resolved.conf (+reboot)
Code:
May 20 13:16:35 myname dbus-daemon[148]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.8' (uid=0 pid=634 comm="hostnamectl set-hostname myname.mydomain " label="unconfined")
May 20 13:16:35 myname systemd-resolved[164]: System hostname changed to 'myname.mydomain'.
May 20 13:16:35 myname systemd-hostnamed[635]: Changed static host name to 'myname.mydomain'