2

I have a domain "blabla.com" with some registrar. I have a number of ELBs to serve the traffic but their domain names change constantly.

I would like to route the blabla.com traffic to the ELBs from within AWS route53 to benefit from the advanced routing (weigthed routing, etc).

Is there a way to setup this up?

I created a hosted zone for blabla.com in route53, and I was thinking to create a CNAME from the registrar but I don't know where to point it to. I can't point it to the ELBs because they don't have a fixed domain name. Somehow I need a way to say "redirect everything to AWS" so that AWS uses my route53 rules to redirect the traffic.

Any idea on how to achieve something like this?

benji
  • 487
  • 1
  • 5
  • 11
  • "I have a number of ELBs to serve the traffic but their domain names change constantly." Unless you are doing this yourself, they shouldn't. The IPs can/do change. – Mark Wagner Dec 12 '18 at 00:51
  • The process I have is recreating an ELB resource and I can't change this part. New ELB -> new domain name. – benji Dec 12 '18 at 18:02
  • You could use something like CloudFront or Terraform. But your DNS provider would have to be managed by those tools too. They could create your ELB and when the ELB changes also update DNS for you. – Mike Marseglia Dec 12 '18 at 18:53

1 Answers1

2

You want to route traffic for the domain "blabla.com" to your ELB. Because "blabla.com" is the top node in the DNS namespace, aka zone apex, you can't use a CNAME record. You can't use an A record that points to the IP address of the ELB because the IP changes.

The solution is to use an Alias Record, an extension of Route53. An Alias Record points to an AWS resource. Route53 automatically detects changes in the resource and updates the DNS record.

See this documention from AWS on Alias Records and how to use them. https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-choosing-alias-non-alias.html

Mike Marseglia
  • 913
  • 8
  • 18
  • But blabla.com is not managed by AWS, it's on a separate registrar and they don't have those ALIAS records. – benji Dec 12 '18 at 18:01
  • @bananasplit in the question, "I created a hosted zone for blabla.com in route53" . You can register a domain and still point the DNS servers to Route53 to take advantage of the Alias records. – Mike Marseglia Dec 12 '18 at 18:48