0
votes

I have two hosted zones in Route53:

  1. domain1.com > A record > Simple routing policy > my_load_balancer

  2. domain2.com > A record > Simple routing policy > my_load_balancer

my_load_balancer is the same for both A records. I'd like to use the same application load balancer (my_load_balancer) to forward the requests to domain1.com to target1, and domain2.com requests to target2 (I have created the rules on the load balancer already). However, I am getting "request timed out" for domain2 and cannot figure out the cause. It looks like Route53 does not resolve for the second domain pointing to the same load balancer

Is 1 load balancer for 2 targets/domains (hosted on 2 different instances) possible at all (I read somewhere that it is possible)? What is missing? Please, advise

1

1 Answers

0
votes

In case someone else comes across the same. The above (and below) setup works fine. The basic settings are as follows:

Route53:
Hosted zone domain1.com: A record > my_app_load_balancer
Hosted zone domain2.com: A record > my_app_load_balancer
(where my_app_load_balancer is the same load balancer)

On the load balancer:
Rule 1: if host is domain1.com then forward to the target for domain1.com
Default rule: if host is domain2.com then forward to the target for domain2.com

In my case this was not working due to the DNS cache issues on my machine. I was testing from Windows, so to make it work I did >ipconfig /flushdns