0

Is it possible to configure multiple private hosted zones with the same domain and have them resolve to different servers?

PHZ1/VPC1 - example.com -> ServerA in VPC1

PHZ2/VPC2 - example.com -> ServerB in VPC2

Each PHZ is associated with one distinct VPC.

We'd like services in each VPC to be able to rely on the same URL for an internal service that has a copy in each VPC.

I've reviewed answers on using multiple public hosted zones, split-dns for hosted zones, and overlapping domains for PHZs that share VPCs but I haven't found an answer for this specific configuration.

1 Answer 1

3

Yes it is possible to create multiple private hosted zones with the same domain name in the same AWS account - I just tried it. I have in the past created private hosted zones in a central AWS account and associated them with a VPC in another account.

Within the same account these two CLI commands will be helpful, which came from this blog post.

# Associate the VPC with a hosted zone
aws route53 associate-vpc-with-hosted-zone --hosted-zone-id **HOSTED_ZONE_ID** --vpc VPCRegion=us-east-1,VPCId==***VPC-ID***

# Remove any VPC associations not required
aws route53 disassociate-vpc-from-hosted-zone --hosted-zone-id **HOSTED_ZONE_ID** --vpc VPCRegion=us-east-1,VPCId=**VPC-ID**

One of the great things about AWS is it's really quick and easy to try things out - it took me 2 minutes to create a couple of private hosted zones to try this myself :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .