The Strato Linux V-Servers always reset their hostnames to hXXXXXX.stratoserver.net on boot, no matter what you put in /etc/hostname and there’s no way to fix this (it’s actually intended behavior). If you happen to have a Strato V-Server running Debian, here’s a simple failsafe way to fix the hostname early during boot and have all daemons use your desired hostname.

Assuming that your desired fully qualified hostname is www.example.org, then create a new file /etc/init.d/strato-hostname-fix.sh with the following content

and setup the script using the following command:

Afterwards just reboot the machine. The above was successfully tested with Debian 6.0.4 (squeeze), and should also work with recent Ubuntu versions.