I am configuring a few domain names in Route53 and am looking for some advice on best practices for setting things up. Here is the scenario:
Let's say domain1.com is my master corporate domain, and I also have domain2.com and domain3.com.
Suppose I have two Amazon EC2 instances defined as a web and database server, with elastic IPs of 18.104.22.168 and 22.214.171.124 respectively, and I want to address them externally as:
Let's further suppose that the website for domain1.com is hosted on one of the above instances, which means that I must set an A record for domain1.com (right?) to the elastic IP of the web instance. So I create record sets in Route53 like:
domain1.com. A 126.96.36.199 prod-web01.domain1.com. A 188.8.131.52 prod-db02.domain1.com. A 184.108.40.206 www.domain1.com. CNAME prod-web01.domain1.com
Now, both domain2.com and domain3.com are also hosted on that web01 instance above, so I create record sets for them like:
domain2.com. A 220.127.116.11 www.domain2.com. CNAME prod-web01.domain1.com.
domain3.com. A 18.104.22.168 www.domain3.com. CNAME prod-web01.domain1.com.
This all works just fine, but it is not as elegant as I was hoping for. I am wondering if there is some way to set up this type of configuration in which there are fewer records pointing to direct IP addresses.
My understanding is that I can't use a CNAME record for the root of a domain (right?), so is there some other way to set things so that I only have one "hard" reference to each IP in my DNS infrastructure?
If not, does this seem like a smart setup? Or a dumb one? Feel free to tell me I'm dumb. :)