Hi I am using an elastic loadbalancer from amazon. The problem I am having is that I first had an A record for my domain which pointed to the IP of the loadbalancer. This however only works for a short while because the ip of the loadbalancer is not static. So to resolve this I removed the A record and added a CNAME record with name www.example.com and pointing to the DNS address of the loadbalancer.

The weird behavior I am getting however is that when I go to example.com sometimes it cant find a dns record. If I go to https://www.example.com or http://www.example.com it will resolve and when I then try example.com afterwards it also works for a while.

Does anyone of you know what might be causing this weird behavior and how to fix it ?


  • 1
    In this case I think you'll have to post your domain name so we can look at the DNS directly. – Tim Oct 28 '17 at 17:47
  • @Tim its vionero.com – Arno_Geismar Oct 28 '17 at 17:52
  • 1
    Your root domain can not be a CNAME record and still have child records. The solution to this is using a route53 alias record. – jordanm Oct 28 '17 at 18:15

When using an Amazon Load Balancer you also need to use ALIAS DNS records. You did not mention that you are using Route 53 but you will need to. You will need to use ALIAS records for the domain root (mydomain.com) and each subdomain (www.mydomain.com) that points to the load balancer.

This link explains how to setup ALIAS records for load balancers.

Routing Traffic to an ELB Load Balancer

  • 1
    Route53 is the best way to use an ELB, but can a CNAME in a standard DNS server work? I think there's an issue with www vs non-www though, since from memory you can't have a CNAME at the domain root. – Tim Oct 28 '17 at 20:52
  • 1
    Amazon created ALIAS records just for this issue: the root domain resource record cannot be a CNAME. You will need to switch over to Route 53, which by the way is very easy and I highly recommend doing this. – John Hanley Oct 28 '17 at 20:54
  • 1
    I know it's the best way, but it is possible to work around? I suspect it is. For example perhaps have the ELB using the WWW subdomain, and your web server can send redirects from the domain apex to the www subdomain - it's not ideal, but it could potentially work. I know CloudFlare has a solution, but that's not entirely standard. – Tim Oct 28 '17 at 20:56
  • @JohnHanley I setup my domain at Route 53 and created an alias record for www.vionero.com and vionero.com , yet when I try the latter I do not reach my site. I get the message that the dns name could not be resolved. Do you have any ideas how this is possible ? – Arno_Geismar Nov 3 '17 at 14:05
  • HTTP or HTTPS? What is the TTL for the problem record? Double check the Route 53 record entries. If you still have problems, create a new question and include your Route53 records. I will be happy to look at them. – John Hanley Nov 3 '17 at 14:10

I can answer my own question. I removed my hosted zone after transfering my domain to route 53. Then I recreated it but the nameservers where out of sync with my registered domain.

Thanks for the help all

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.