LXC container with FQDN

Fchen

New Member
Jul 17, 2017
12
0
1
33
I'm trying to set an FQDN for a container with VestaCP installed on but everytime the container reboots the config from /etc/hostname and /etc/hosts will be overwritten, is there a way to set an FQDN?
 
Set the hostname in the DNS tab in the webui. The search domain of your host will then be happened to form the FQDN wich will be persistent when rebooting.
 
Hostname in the web UI is set to FQDN and DNS domain is also set to the domain (without hostname) but the command hostname or hostname -f will still output the hostname itself, also in /etc/hosts only the hostname is present.
 
Your hostname in the DNS tab of your container should be the hostname and not the FQDN. It should be like this:
Container hostname: production-1
Host search domain: example.com

Which would set the FQDN in your container to example-1.example.com

There is no need to mess with /etc/hostname and /etc/hosts
 
No matter if I name the server production-0 or production-0.example.com, hostname -f will output only the hostname itself, not the FQDN.

My SMTP server needs the FQDN for a correct HELO/EHLO.