Search code examples
amazon-web-servicesamazon-route53

Connect AWS Hosted Zone To Registered domains


I want to connect my domain (in AWS Registered Domains) to the IP address of my Ec2 instance in my AWS account; so that I can type www.my-domain.com in any browser and open my website.

I transferred a domain name from my old AWS account to a new one. Usually AWS creates a hosted zone for the domain automatically, but it didn't.

So I created my own hosted zone and and added and two A records (www.a.com and a.com) with value connected to the IP address of my Ec2 instance but the browsers didn't recognize the domain.

So I tried:

  1. Updating the Name servers of the hosted zone to be the same as the domain name NS But same result
  2. Updating the Name servers of the domain name to be the same as the hosted zone NS But same result

What can I do?

Thanks.


Solution

  • I don't know if this could count as and answer but this is what I did to fix the problem:

    1. I created and Application Load Balancer
    2. With Security Group with Inbound rules: HTTP TCP 80 0.0.0.0/0, ::/0
    3. And Target Group TCP 80 Set to Ec2 instance.
    4. Connect the A record to the ALB

    This fixed my problem