How to change hostname for OpenVZ virtual server
vzctl set <CTID> --hostname <newhostname> --save
vzctl set <CTID> --hostname <newhostname> --save
If you try to import / restore some big MySQL database you may have encountered such error:
MySQL server has gone away (error 2006)
To fix it you would need to increase wait_timeout and max_allowed_packet:
wait_timeout = 6000 max_allowed_packet = 128M
It should fix the problem.
if you need to send emails from your Postfix server using MX records instead of local delivery you should leave the following line empty:
mydestination = $myhostname, localhost.$mydomain, localhost
in /etc/postfix/main.cf.
This way:
mydestination =
And restart the server:
/etc/init.d/postfix restart