1

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

2 Answers 2

2

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 ;-))

3
  • hm there is no elegant way, is there?
    – Lydon Ch
    Mar 19, 2010 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 Mar 19, 2010 at 6:36
  • You can put a short TTL in the CNAME, which will make it more effective.
    – Warner
    Mar 19, 2010 at 13:20
1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .