Search code examples
amazon-web-servicesdnsamazon-rdsamazon-route53

Connecting with RDS using internal hosted zone


I have two VPC's one for RDS and another for EKS cluster in one account and I have Route53 config in root account, VPC pairing is enabled to connect all the VPC. I can connect with the rds using direct endpoint but when I am using the private internal hosted zone then I get the below error

ERROR 2005 (HY000): Unknown MySQL server host 'dbname.database.internal' (2)

I want my application to point RDS using private hosted zone, I have DNS hostname and DNS resolution enabled I have VPC enabled Sg of RDS is allowing traffic.

Any help what I would be missing would be appreciated


Solution

  • By default, a private hosted zone is associated with a single VPC. You get Unknown MySQL server host error because only the RDS VPC knows how to resolve the 'dbname.database.internal' DNS. You need to associate the EKS VPC with the private hosted zone:

    1. Sign in to the AWS Management Console and open the Route 53 console at https://console.aws.amazon.com/route53/.

    2. In the navigation pane, choose Hosted zones.

    3. Choose the radio button for the private hosted zone that you want to associate more VPCs with.

    4. Choose Edit.

    5. Choose Add VPC.

    6. Choose the Region and the ID of the VPC that you want to associate with this hosted zone.

    7. To associate more VPCs with this hosted zone, repeat steps 5 and 6.

    8. Choose Save changes.

    Source: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/hosted-zone-private-associate-vpcs.html