Why is the Hosted Zone ID different for ELB and Route 53 Alias ​​Target?

Here is my Sid-LB load balancer - the Hosted Zone ID is highlighted:

enter image description here

And this is route No. 53 (the identifier of the hosted zone is highlighted) when I select load balancing from Alias ​​Target.

enter image description here

I do not understand why these two IDs should be different. I tried to send an API call with a payload (containing the ELB zone identifier) ​​to create a recordset that it creates but does not work. How is this Hosted Zone Alias ​​ID for generated route 53 and does it have any connection with the Hosted Zone ELB ID?

+6
source share
3 answers

We cannot create a recordset with the Hosted Zone ID specified by the endpoint, as this is not a valid mapping. We need the Hosted Zone ID to be displayed correctly.

Since it (the Hosted Zone Alias ​​ID for Route53) is generated automatically, and there is no api call to get that ID, the only workaround is to create a CNAME record set with the value as the ELB endpoint (or S3 console endpoint or CloudFront endpoint point).

0
source

docs are a bit vague:

This value appears automatically depending on the value you have selected or specified for Alias ​​Target.

However, the zone identifier with the Alias ​​alias does not match the Hosted Zone identifier. To create an Alias ​​record, you just need a Hosted Zoned ID. Check out some sample queries here . All of them accept the HostedZoneId parameter.

So, for your use case, I think you can just ignore it. All you need to know is that the “Hosted Zone ID” and the Alias ​​record “Alias ​​Hosted Zone ID” are not the same thing.

+2
source

Here you can get the identifier of the hosting zone for balancing elastic load: https://docs.aws.amazon.com/general/latest/gr/rande.html#elb_region

In your case, I can see that the Hosted Zone ID for US West (Oregon) is us-west-2.

0
source

All Articles