During instance creation, the hostname of the instance is given the name of the instance; thus if you created an instance with the name ‘foo.example.com’ the hostname of the instance would be ‘foo.example.com’ instead of just ‘foo’ as one may expect. Further, all instances are put into our existing domain ‘cloud.cybera.ca’, so this unfortunately named instance would now have ‘foo.example.com.cloud.cybera.ca’ as its fully-qualified domain name (FQDN).
Changing a hostname in Linux is not a straight-forward prospect, as the implications of a change affect much of the fundamental operation; for example, if you were to incorrectly change the hostname in Ubuntu, sudo will no longer function!
In order to change a hostname for your Rapid Access Cloud instance:
As root, create a file in
/etc/cloud/cloud.cfg.d/
named99_hostname.cfg
with the following:#cloud-config hostname: <desired_hostname> fqdn: <desired_hostname>.<your_domain_name>
Again as root, edit
/etc/hosts
to include the line:127.0.0.1 <desired_hostname> <desired_hostname>.<your_domain_name>
Reboot the instance to allow the cloud-init scripts to apply the changes (done only at boot).