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 mistakenly asked this question in stackoverlow however, it probably makes more sense here.

My application is on amazon and i am using their EC2 loadbalancer. Amazon states on their site:

DNS Name:
Note: Because the set of IP addresses associated with a LoadBalancer can change over time, 
you should never create an "A" record with any specific IP address. If you want to use a friendly 
DNS name for your LoadBalancer instead of the name generated by the Elastic Load Balancing 
service, you should create a CNAME record for the LoadBalancer DNS name. For more information 
about CNAME records, see the CNAME Record Wikipedia article.

I created a CNAME record host www mapping to the loadbalancer above in the DNS. forwards to the right appserver. (Cool)

However, I noticed that when I type instead of it goes to the default A record which is mapped to a different IP and not the loadbalancer. How do I fix this? I want both and to go to the same loadbalancer. I think I need to do this in the DNS, right?

Note: I verified the above by pinging both addresses.

share|improve this question
up vote 3 down vote accepted

I want both and to go to the same loadbalancer.

You can't. This is a known design limitation, which comes from a combination of how Amazon Elastic Load Balancer (ELB) is implemented and long standing design choices for DNS.

You cannot make a CNAME entry for your naked 2nd level domain. I.e. must be an A-Record pointing directly to an IP address.

However, Amazon's ELB depends on a custom DNS & EC2 platform created by Amazon, which requires your DNS entry to be a CNAME pointing to your Amazon ELB domain name (i.e.

Taken together, what this basically means is that you can only use 3rd level domain names with ELB, for example or . And these have to be CNAMES, pointing to your ELB instance.

So for the naked 2nd level domain (@) itself you must:

Just about any decent domain registrar or DNS host should have a free or very cheap way of doing this. You could also do it yourself, by running an EC2 instance with a webserver on it, but why bother...

I don't know GoDaddy's UI for this looks, as I have never used them myself. But f.x. Gandi has free-of-charge HTTP redirection called "Web Forwarding", and GoDaddy seems to have a "Site Redirect Manager".

In real life, this isn't really an issue for end users. After a short while all search engine indexing and all end user bookmarks will point to, so the number of users who enter through and get redirected will be tiny. And for those users, it's a short delay (maybe 100-200 ms), and it should only happen once.

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.