Amazon gives us a very long dns names i.e. c-123-123-123-255.compute-1.amazonaws.com Is there a way to map this name into a shorter name

i.e. essentially what i want to do is to modify /etc/hosts file, and map the long name into a short one, i.e. aws1 c-123-123-123-255.compute-1.amazonaws.com

but because /etc/hosts file only accepts ip address mapping, then I cannot do that.

Is there any other way to do this?

Thanks

link|improve this question

50% accept rate
feedback

2 Answers

up vote 2 down vote accepted

If you get an elastic IP then you could add it to your server and then stick a short name for that in /etc/hosts - other than that you can do it with a CNAME in DNS, but that would break when you instances name/ip changes (hence me saying use an elastic ip ;-))

link|improve this answer
hm there is no elegant way, is there? – user32425 Mar 19 '10 at 6:18
The scalable way is to use elastic ip's and DNS. anything else will become a PITA once you have more than a few instances runnig – c10k Consulting Mar 19 '10 at 6:36
You can put a short TTL in the CNAME, which will make it more effective. – Warner Mar 19 '10 at 13:20
feedback

The only effective way to do this is to get your own domain name and put a CNAME in that domain pointing at the Amazon instance.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.