Here is my load balancer Sid-LB - the Hosted Zone ID is highlighted:
And this is the Route 53 (hosted zone id is highlighted) when I select the load balancer from Alias Target.
I dont understand why these two IDs have to be different. I tried to send an API call with the payload (containing the ELB hosted zone id) to create the record set, which it creates but doesnt work. How is this Alias Hosted Zone ID for Route 53 generated and does it have any connection with the ELB Hosted Zone ID??
ELB distributes traffic among Multiple Availability Zone but not to multiple Regions. Route53 can distribute traffic among multiple Regions. In short, ELBs are intended to load balance across EC2 instances in a single region whereas DNS load-balancing (Route53) is intended to help balance traffic across regions.
A hosted zone is a container for records, and records contain information about how you want to route traffic for a specific domain, such as example.com, and its subdomains (acme.example.com, zenith.example.com). A hosted zone and the corresponding domain have the same name.
Route 53 allows you to create a second (or third, etc.) hosted zone with 4 different name servers. Also, of course, it makes sense to have this information locally to avoid making unnecessary API requests, which can cost time and money. The hosted zone id is, as you likely noticed, also visible in the console.
You can get the Hosted Zone ID of Elastic Load Balancing here: https://docs.aws.amazon.com/general/latest/gr/elb.html
In your case I can see that the Hosted Zone ID is the one for US West (Oregon) - us-west-2.
The docs are a little vague about this:
This value appears automatically based on the value that you selected or entered for Alias Target.
However, the Alias Hosted Zone ID is not the same as the Hosted Zone ID. To create an Alias record, you just need the Hosted Zoned ID. Check out some of the sample requests provided here. They all take a 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 an Alias record's 'Alias Hosted Zone ID' are not the same thing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With