News for hackers. Stuff that matters.
Re:Load Balancers need static IPs by js2 on Wednesday September 01, 2010 @09:59PM (#1655006)
Here's how we solve this.

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.

Re:Load Balancers need static IPs by forkqueue on Thursday September 02, 2010 @02:25AM (#1655454)
Great, except for when your users DNS resolvers cache the DNS entry longer than they're supposed to (many resolvers ignore TTL), and are unable to reach your site.
Re:Load Balancers need static IPs by js2 on Thursday September 02, 2010 @03:32AM (#1655531)
No. Amazon gives you an A record and asks you to make a CNAME for it. So when they change an ELB's IP, they update their A record. So in our case, we just make sure our A records follow along. Either way, a DNS cache holding onto a stale record too long would cause a problem.

Which is why Amazon keeps the ELB active on both the old and new IPs for a period of time.