Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Background : I have a domain, lets say I assign an elastic IP to a instance on EC2 and give it the dns name as
I want to put 5 instances of EC2 under this domain, like so :,,...

Question :

1 - is the above said possible ?
2 - if yes how to achieve it ? if no, whats the work around ?


share|improve this question
up vote 1 down vote accepted

Yes, it is possible.

For the single "" server, you must use an elastic IP and assign the A record of to that IP. This is due to the "zone apex" issue.

For all other sub-domains, I recommend you use a CNAME from "" to the EC2-assigned domain name (e.g. ""). This method has two benefits:

  1. You do not exhaust your limit on elastic IPs

  2. When referring to these systems, AWS EC2 DNS servers always report the correct IP - if it is being referenced externally it gives the external IP and if being used inside the EC2 cloud it gives the internal IP (no additional bandwidth cost)

share|improve this answer
Thanks for saying "it is possible" :) And +1 for the links And "Accepted" for the instructions on how to achieve it :) – Shrinath Feb 17 '11 at 7:25

The easiest way is to use the other 4 elastic IPs and apply them to the i-N instances, in which case they'll just be additional DNS entries for those other IPs in your public DNS---no different from

A slightly less ugly version (but much more involved) method would be to run a reverse proxy that looks at the requests coming in and forwards them to the internal addresses of the instances based on something identifiable at the application layer (e.g. HTTP vhost)

An uglier version would involve procuring a hosted + dynamic DNS service for, and writing a startup script that would update the DNS for the i-N instances appropriately.

share|improve this answer
when "5" becomes "N", then we've a problem... we cant buy all the elastic ips in the Amazon farm, no ? :D – Shrinath Feb 16 '11 at 6:19
Hence the proxy and DDNS alternatives :-P – James Cape Feb 16 '11 at 12:49

Your Answer


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.