I have several Amazon EC2 servers and I'm using Chef to manage the configuration. I'd like to set the hostname so that the default bash prompt is more helpful.
Right now after launching a new server it's just set as:
Since I'm using Ubuntu 12 on these boxes I consulted the corresponding man page for hostname. It has a lot of good information on how to set it, and talks a little about the hostname and the fqdn, but it doesn't really tell me what I want to know:
What are the ramifications of setting the hostname?
I'd like to assume that setting the hostname is mostly a convenience item for users and sysadmins, giving the box a face / nice-name so it can be more easily recognized internally (via the command prompt, e-mails that are sent, etc), but I'm not positive.
I don't see the hostname listed in the
/etc/hosts file, which appears to be a good sign that
it won't affect anything negatively if changed:
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
Am I on the right track? What are the ramifications of setting the hostname?
I tried changing the hostname on my ec2 instance from
hostname --fqdn no longer works. If I put it back then it works fine. Apache also gives me an error when starting that it can't reliably determine the fqdn. I suppose there must be some way to set the hostname without messing up the fqdn.