Load Balancers need static IPs
blog.pagerduty.com
blog.pagerduty.com
We host our DNS with DNS Made Easy, but you could also run your own DNS servers. (We actually have a pair of EC2 instances that we configured as DNS servers and then shut them down, so we're paying a minimal amount for them, but can spin them up very quickly the next time DME is hit with a DDOS.)
We query the ELB CNAME periodically and check its IP. If the IP changes, we update our corresponding A records with the new IP. It's a small amount of code and a cronjob that runs every 5 minutes.
Elegant? No. Get the job done? Absolutely.
Which is why Amazon keeps the ELB active on both the old and new IPs for a period of time.
Also there's additional cost involved in using ELB.
I would prefer having a good dns provider, low ttl, EIP, nginx w/haproxy.
However, the problem with using CNAMEs for LBs is that you can't both host mail and a site at the same subdomain. Ideally, what I would want to do is set up redundant MX records for .pagerduty.com to our mail servers, and also set a CNAME from .pagerduty.com to the ELB for to handle the web traffic. The DNS spec doesn't allow this though (it would be ambiguous).
I've thought about using round robin DNS with a low TTL instead of an ELB. Problem there is you don't get all the fancy auto-scaling stuff. I've also heard rumors that some ISPs have their DNS servers configured to put a floor on the retrieved TTL values...
Unless I've drunk too much AWS Koolaid, I'm fairly certain you can run wildcard DNS for just the MX records for your domain. That entry would look something like:
*.example.com. 3600 IN MX 10 mail server.example.com.
Your mail servers can take the DNS synthesized domain from there I think.
BTW, I agree serving naked domains is a bit of a PITA, (appengine problem too!) but you can solve that by assigning a few elastic IPs to a few web heads and use RR DNS for them, with some code to take them out if one fails. Zerigo, for one, supports doing something like this IIRC.
302 anyone using the naked domain to the www. I doubt it matters much load wise as it sounds as if your running subdomains for your app like we do at Loggly.
You'd need to do: acme MX (mail_server_ip) acme CNAME (ELB hostname)
... but that isn't allowed. The problem is with the records conflicting, not with the wildcard.
Is it widely implemented yet? Why not?
This all happens because it creates ambiguity. If you want to look up the MX record of a name that has both MX and CNAME entries (say acme.pagerduty.com), should the name resolver:
a) Grab the MX record at acme.pagerduty.com; OR
b) Do what is usually implied by a CNAME record, and pull the target of acme.pagerduty.com, and search for an MX record at that name?
Because of the potential for conflict, the DNS spec simply forbids CNAME records from existing alongside most other records.
Our service required a load balanced service and just like you we identified the issues and decided we could not live with the limitations.
So we brought up a small instance and run HAProxy on it to do all our load balancing. We assign an Elastic IP and we get to retain control, avoid the DNS issues, do https etc.
Essentially avoiding all the limitations of the Amazon offering.
AWS themselves use HaProxy for Elastic Load balancing and its solid.
Basically, they are doing load balancing for their load balancers. :)