0

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 ?

Regards,

3
  • 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, 2017 at 17:47
  • @Tim its vionero.com Oct 28, 2017 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, 2017 at 18:15

2 Answers 2

2

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

6
  • 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, 2017 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. Oct 28, 2017 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, 2017 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 ? Nov 3, 2017 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. Nov 3, 2017 at 14:10
0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .