Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

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

share|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 –  Geraint Jones 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

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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