Subchapter 91.7
references/resolving-private-dns-for-hybrid-networks.mdMarkdown15 KBView on GitHub
Domain expertise for private DNS resolution in both directions across a hybrid network: AWS workloads resolving on-premises hostnames, and on-premises workloads resolving AWS private hosted zones. Spans private hosted zones and VPC Resolver (also known as Route 53 Resolver) inbound and outbound endpoints with conditional forwarding. Covers the connectivity precondition, the endpoint-direction confusion, the forwarding-rule step, and multi-account rule sharing.
Does not cover the connectivity layer itself (AWS Direct Connect or VPN setup) beyond treating it as a prerequisite, or VPC Resolver on AWS Outposts. Those are separate skills.
Execute commands using the AWS MCP server when connected (sandboxed execution, audit logging, observability). Fall back to the AWS CLI otherwise.
To build hybrid DNS resolution, follow the procedure exactly. See the Procedure section below.
The procedure covers:
None of the DNS components resolve anything without a working AWS Direct Connect or VPN connection between the VPC and on-premises.
Constraints:
This is the most common point of confusion. The direction names which way queries flow.
| Endpoint | Direction | Enables |
|---|---|---|
| Inbound | On-premises to AWS | On-premises clients resolve AWS private hosted zone records |
| Outbound | AWS to on-premises | AWS clients resolve on-premises hostnames (needs a forwarding rule) |
Constraints:
0.0.0.0/0: inbound TCP/UDP 53 from the on-premises ranges on an inbound
endpoint, outbound TCP/UDP 53 to the on-premises DNS server IPs on an outbound endpoint. An
open 0.0.0.0/0 rule exposes the resolver to unauthorized queries| Choice | Use when |
|---|---|
| Shared rules from a hub VPC via RAM | Multi-account setups, to avoid the drift of recreating rules per account |
| Per-account rules | A single isolated account |
No Direct Connect or VPN path is carrying queries. Confirm connectivity first; build DNS only once a path exists.
Wrong endpoint type for the needed direction. Inbound for on-premises-to-AWS, outbound for AWS-to-on-premises.
No conditional forwarding rule. Add a rule naming the on-premises domains and DNS server IPs.
Rules were recreated per account. Share rules from a hub VPC through AWS RAM.
The security group attached to the endpoint may have incorrect or connection-tracking rules. Check that:
Certain security group rules cause connection tracking, which can reduce max queries per second significantly. See Values for inbound endpoints (opens in a new tab) and Values for outbound endpoints (opens in a new tab) for guidance on avoiding this.
This procedure builds private DNS resolution in both directions across a hybrid network. It confirms a network path exists, creates VPC Resolver inbound and outbound endpoints for the needed directions, adds the conditional forwarding rule that makes outbound resolution work, shares resolver rules across accounts, and surfaces the console links to verify.
vpc-0abc123).us-east-1).inbound, outbound, or both.corp.example.com).IP or
IP:PORT. Port defaults to 53 if omitted. Specify multiple entries for redundancy
(e.g., ["10.0.0.2", "10.0.0.3:5353"]).0.0.0.0/0.uuidgen; do not ask the customer for it.Constraints for parameter acquisition:
Constraints:
aws sts get-caller-identityaws sts assume-role) rather than long-lived IAM user access keys.Constraints:
If direction is inbound or both, create an inbound endpoint so on-premises clients can
resolve AWS private hosted zone records:
aws route53resolver create-resolver-endpoint \
--creator-request-id $(uuidgen) \
--name {name} --direction INBOUND \
--security-group-ids {sg_id} \
--ip-addresses SubnetId={subnet_a} SubnetId={subnet_b} \
--region {region}You SHOULD recommend that on-premises clients connect to the inbound endpoint over DoT (DNS over TLS) or DoH (DNS over HTTPS) rather than plaintext Do53, because Do53 exposes queried domain names to on-path observers on the hybrid link
Constraints:
If direction is outbound or both, create an outbound endpoint:
aws route53resolver create-resolver-endpoint \
--creator-request-id $(uuidgen) \
--name {name} --direction OUTBOUND \
--security-group-ids {sg_id} \
--ip-addresses SubnetId={subnet_a} SubnetId={subnet_b} \
--region {region}Constraints:
If direction is outbound or both, you MUST create a forwarding rule for outbound resolution
(skip this step entirely when direction is inbound only — on_prem_domains and
on_prem_dns_servers are not provided in that case). The outbound endpoint does nothing
until a rule names the on-premises domains and DNS server IPs:
aws route53resolver create-resolver-rule \
--creator-request-id $(uuidgen) \
--name {name} --rule-type FORWARD \
--domain-name {on_prem_domain} \
--resolver-endpoint-id {outbound_endpoint_id} \
{target_ips_flags} \
--region {region}Parse each entry in on_prem_dns_servers as IP or IP:PORT, defaulting port to 53 if
omitted. Build {target_ips_flags} as a single --target-ips flag followed by one
Ip={ip},Port={port} argument per entry
(e.g., --target-ips Ip=10.0.0.2,Port=53 Ip=10.0.0.3,Port=5353).
You MUST associate the rule with the VPC:
aws route53resolver associate-resolver-rule \
--resolver-rule-id {rule_id} --vpc-id {vpc_id} --region {region}Constraints:
If share_principals is set, you SHOULD share the rules from a hub VPC through RAM rather than
recreating them per account:
aws ram create-resource-share \
--name {share_name} --resource-arns {rule_arn} \
--principals {share_principals} --region {region}The receiving account must accept the RAM resource share invitation before the rule is usable:
aws ram accept-resource-share-invitation \
--resource-share-invitation-arn {invitation_arn} --region {region}After accepting, the receiving account must associate the shared rule with its VPC:
aws route53resolver associate-resolver-rule \
--resolver-rule-id {rule_id} --vpc-id {consumer_vpc_id} --region {region}Constraints:
{region}:
Inbound endpoints:
https://console.aws.amazon.com/route53resolver/home?region={region}#/inbound-endpointsOutbound endpoints:
https://console.aws.amazon.com/route53resolver/home?region={region}#/outbound-endpointsForwarding rules:
https://console.aws.amazon.com/route53resolver/home?region={region}#/rules{
"vpc_id": "vpc-0abc123",
"region": "us-east-1",
"direction": "both",
"security_group_ids": ["sg-0abc123"],
"subnet_ids": ["subnet-0aaa111", "subnet-0bbb222"],
"on_prem_domains": ["corp.example.com"],
"on_prem_dns_servers": ["10.0.0.2", "10.0.0.3:5353"]
}Created inbound and outbound endpoints in vpc-0abc123, plus a forwarding rule for
corp.example.com -> 10.0.0.2:53, 10.0.0.3:5353.
Verify in the console:
Inbound: https://console.aws.amazon.com/route53resolver/home?region=us-east-1#/inbound-endpoints
Outbound: https://console.aws.amazon.com/route53resolver/home?region=us-east-1#/outbound-endpoints
Rules: https://console.aws.amazon.com/route53resolver/home?region=us-east-1#/rulesNo Direct Connect or VPN path. Confirm connectivity first (Step 1).
Wrong endpoint type for the needed direction (Steps 2 and 3).
No conditional forwarding rule. Add one naming the on-premises domains and DNS server IPs (Step 4).
Rules recreated per account. Share from a hub VPC through RAM (Step 5).
Check the security group rules for the endpoint:
Certain rules cause connection tracking and reduce max queries per second. See Values for inbound endpoints (opens in a new tab) and Values for outbound endpoints (opens in a new tab).
aws sts assume-role) rather than
long-lived IAM user access keys, and prefer read-only credentials for inspection steps.0.0.0.0/0, because an open rule exposes the resolver to
unauthorized queries from anywhere on the hybrid link.