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

Lydon Ch
  • 277
  • 1
  • 2
  • 12

2 Answers2

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

Geraint Jones
  • 2,503
  • 16
  • 19
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.

Alnitak
  • 21,191
  • 3
  • 52
  • 82