Changing hostname on ubuntu-server (VPS) - recommended or not?

I started paying for a VPS-server at Contabo.com recently. I've read quite a few guides about setting up a VPS-server properly, - but I can't find any 'best practice' regarding the hostname.

At the moment, it's quite the horrible hostname (along the lines of: vmi123456.contaboserver.net). I can understand that I simply can change it, by changing it in /etc/hostname (it's a Ubuntu 16.04 server). But somewhere I read that some hosting-companies reset the hostname upon rebooting.

But no one addresses my issue... Should I do it? Because what if someone else has a server with Contabo, and both he and I rename the server to foo.contaboserver.net? What will then happen - which consequences will that cause? And is it cool to do it, as long as I choose something that has a high chance of being unique? And can I check if a given hostname is available or not?

Or an even better question is, - what if someone else renames their VPS to have the same name as mine currently have (vmi123456.contaboserver.net) - will that cause me problems?


Changing a hostname of a VPS to your domain name is recommended. If any other user has the same hostname it does not matter as host name does not come under any DNS purview. So its absolutely safe to change your VPS hostname.


VPS in Contabo includes the possibility to install Webmin when you create the VPS, if you have access to the webmin session, you can change the hostname in the Network menu. There, you will find the hosts files in the hostnames tab. Be careful with the warning messages, due you could erase the network configuration and lost access to the VPS, being necessary to access it via VNC.

I recommend you not to use these admin interfaces, due to this kind of problems. For example, I started a fresh Ubuntu 18.04 VPS without any admin interface and I do not have any problems touching my configuration files, nothing changes the files that I touched, it is just like a real machine.