How to Setup a Hybrid DNS between your On-Prem and AWS Environment
If you're looking for a way to set up a Hybrid DNS system that allows smooth DNS queries between your on-premise and AWS environments, you're in the right place.
I've created a Hybrid DNS setup using AWS resources, which simulates a real-world connection between AWS and an on-premise environment. I've also put together easy-to-follow steps so others who need this solution can benefit from it. This is your go-to guide for a user-friendly Hybrid DNS setup.
1. Set up the lab environment: A CloudFormation template is used here to create the infrastructure in AWS. CloudFormation is a service offered by AWS that enables users to define and provision the resources needed for applications across all regions and accounts. The template describes what resources are needed and AWS CloudFormation takes care of provisioning and configuring those resources. The mentioned resources here are EC2 instances, and Virtual Private Clouds (VPCs).
2. Create VPC Peering connection: VPC Peering is a networking connection between two VPCs that enables you to route traffic between them privately. In this case, it's used to connect the AWS VPC with the on-premises VPC. Once the peering connection is created, you add necessary routes to VPC route tables of each VPC to enable the connectivity.
3. Test the connectivity: You would then check the connectivity by pinging private IP addresses of servers from each environment (AWS and On-Premises). Pinging is a diagnostic tool to test connectivity between two nodes.
4. Create Inbound Endpoints and Configure DNS servers: To enable DNS resolving, inbound endpoints are created in AWS VPC. These endpoints act as targets for DNS queries. The on-premises DNS servers are then configured to forward all DNS queries to these inbound endpoints.
5. Connect to App server and configure DNS server IP addresses: The app server needs to know where to query for DNS entries, hence the IP addresses of the DNS servers are added in the app server.
6. Create Outbound Endpoints: In the AWS VPC, outbound endpoints are created. These endpoints are designed to forward any queries made to a certain domain (e.g., corp.aws) to the DNS servers in the on-premises VPC. Forward rule has to be setup in Route53.
7. Enable DNS querying across environments: With the above steps, both on-premises clients and resources on AWS can query for DNS entries on each side, ensuring seamless communication across the hybrid environment.
Credits and special thanks to Adrian Cantrill for creating this project, which is used quite often in production environments.
Top comments (0)