Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I'm told that I can't make the root of a domain ( a CNAME - I have to specify an IP.

Given that you can't use an IP address to point at your Elastic Load Balancer, what's the best thing to do?

Currently I do this: - A record to elastic IP of first server- redirects to CNAME to hostname of load balancer

If the first server is out of action, the redirect will fail.

Is there a better way to approach this?

share|improve this question

your approach is probably the most sane one.

what you could do is Round Robin DNS your root record by just adding multiple A records for the domain and replicate the redirection code accross all your servers. this way its not so reliant on the first server.

if your redirect is a 301, virtually all users will cache the 301 so likely next time they view the site if they went via there browser should (if they dont clear cache) auto redirect to without even checking the servers and then go straight to your load balancer

share|improve this answer
We do exactly this. There is some hope the Amazon's DNS server will solve the redirect to www.domain problem, but until then this is the best way to do it. – kashani Mar 17 '11 at 0:33

Looks like Amazon have now implemented a solution for this.

"Amazon Route 53 has integrated with Amazon EC2’s Elastic Load Balancing in order to easily let you map your root domain, or “zone apex” (e.g.,, without the ‘www’), directly to your Load Balancer."

share|improve this answer

I have found that most domain registrars offer basic DNS tools with domain redirection (HTTP 301) and thus you should be able to set your root entry (e.g. as a redir to or the like. This is all assuming that you are ok with the redir and don't need your site to respond to This would keep you from having to pay for another elastic IP as Amazon.

share|improve this answer

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.