views:

1384

answers:

2

I'm running a couple of standard Fedora instances on EC2. I feel the public hostnames of the instances assigned by Amazon are too weird and hard to remember. I'd like to change them to something short (like red/blue/green/etc).

Is there any draw back in doing this? And how do I set it up such that it persists after reboots?

Thanks.

+2  A: 

Sure, you can do that if you have your own domain (setup a CNAME to point to the Amazon hostname). Otherwise, you're pretty much stuck with the one they give you (or an Elastic IP, if you set one of those up).

obeattie
I can setup CNAMEs. My question is related more to the bash prompt I get which includes the hostname. I'd like this to be more user friendly and would like to know how to set it up such that it stays after reboots and if it causes any problems within AWS's iternal n/w config.
Nikhil Gupte
I just run the hostname command to set the hostname, log out, and log back in.
Barry Brown
Yeah, what Barry said. (Barry, make your comment an answer so I can vote for it.)
Anirvan
Does the hostname set using the hostname command remain after a reboot?
Nikhil Gupte
Nikhil, you can put in /etc/rc.local: hostname myhostname
Jeff Bauer
A: 

If you don't want to mess with your DNS provider, you could use aliases for your instances. I was really surprised that Amazon didn't provide a way to give an alias for an EC2 instance when they came out with the AWS Management Console, but in the meantime, you could use the free RightScale service if you want the alias feature - much easier than remembering those Amazon instance IDs.

gareth_bowles