HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   Hostname for OpenVZ Containers - Question for Falko (http://www.howtoforge.com/forums/showthread.php?t=61292)

darinpeterson 4th April 2013 15:25

Hostname for OpenVZ Containers - Question for Falko
 
Hi Falko,

In the tutorial The Perfect Server - Debian Squeeze (Debian 6.0) With BIND & Courier [ISPConfig 3], you state that it's important that it's important that after running these commands:

Code:

echo server1.example.com > /etc/hostname
/etc/init.d/hostname.sh start

that both of these commands:

Code:

hostname
hostname -f

show "server1.example.com"

With a virtual container in OpenVZ, it will only show "server1.example.com" immediately after running the commands. After reboot it the "hostname" command only shows "server1", however "hostname -f" shows "server1.example.com" if the --hostname configuration is set in the container.

Is there something that can be set in the container configuration so hostname will show the correct hostname?

Thanks,
Darin

SamTzu 4th April 2013 15:46

Only way is to enter the FQDN in the OpenVZ as the VM hostname or manually edit /etc/hostname file and to use chattr +i /etc/hostname.

I recommend the first option.

Normally /etc/hostname should not contain FQDN only the host name but this can be problematic on OpenVZ containers and you might have to manually modify on Postfix config's etc. and add the FQDN later.

darinpeterson 4th April 2013 20:36

Hi SamTzu,

Thank you for the reply.

Quote:

Originally Posted by SamTzu (Post 295341)
Only way is to enter the FQDN in the OpenVZ as the VM hostname or manually edit /etc/hostname file and to use chattr +i /etc/hostname.

I have already set the hostname for the OpenVZ containers as the FQDN, if this is what you're talking about:

Code:

vzctl set mail --hostname server1.example.com --save
However, this does not solve the problem with the requirement that the command "hostname" producing "server1.example.com".

Quote:

Originally Posted by SamTzu (Post 295341)
I recommend the first option.

Normally /etc/hostname should not contain FQDN only the host name but this can be problematic on OpenVZ containers and you might have to manually modify on Postfix config's etc. and add the FQDN later.

If it's not required by ISPConfig, I would rather not change anything that might cause other issues.

If the only reason Falko has asked that the hostname be the FQDN is the concern for a collision of names in ISPConfig, then that would be useful to know. If there are other implications, I would like to know.

If you have more feedback, please provide it.

Regards,
Darin


All times are GMT +2. The time now is 07:05.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.