When your on-premises and cloud networks are connected through VPN or Express Connect, you can use Private Zone to enable bidirectional DNS resolution between on-premises data centers and the cloud, or across multi-cloud environments.
Prerequisites
Your on-premises network is connected to an Alibaba Cloud VPC through a VPN or Express Connect circuit (IPsec-VPN connections).
Solution architecture
Expected outcomes
-
DNS queries for
app.example.comfrom an ECS instance in a VPC reach the on-premises DNS server through an outbound endpoint. -
DNS queries for
test.oss-cn-hangzhou-internal.aliyuncs.comfrom on-premises or external cloud devices are forwarded by the local DNS server to Private Zone through an inbound endpoint.Notetest.oss-cn-hangzhou-internal.aliyuncs.comis an internal OSS endpoint used as an example. Replace it with the actual internal endpoint of your Alibaba Cloud service.
Procedure
Scenario 1: Cloud to on-premises resolution
-
Create outbound endpoints
192.168.100.74and192.168.192.219(Forwarding Management). Verify that both endpoints appear in the Outbound Endpoints list with Outbound Traffic Source IP Address set to the values above and status Normal. -
Create a forwarding rule with the domain name set to
example.com. Specify your on-premises DNS server IP addresses — in this example,192.168.100.100and192.168.100.200.ImportantIf
example.comis already configured as a Private Zone, you must enable the recursive resolution proxy for subdomains. -
Associate the forwarding rule with the VPC that contains your ECS instance (Set the scope for a rule).
-
On an ECS instance in your VPC, run
dig app.example.comto verify the configuration.
Scenario 2: On-premises to cloud resolution
-
Use the service address feature of Private Zone to add an inbound endpoint. In this example, the service IP addresses for inbound traffic are
192.168.0.176and192.168.100.163.WarningEnsure that you associate the Private Zone for
oss-cn-hangzhou-internal.aliyuncs.comwith the inbound VPC. Otherwise, DNS resolution will fail.Important-
Inbound endpoints let you create custom DNS resolver IP addresses within a VPC. Use them when your on-premises CIDR blocks conflict with the default Alibaba Cloud DNS server addresses (
100.100.2.136and100.100.2.138), or when you need to scope DNS resolution to a specific VPC. -
If no IP address conflict exists, use the default Alibaba Cloud DNS server addresses directly.
-
-
On your on-premises DNS server, add a forwarding rule to forward queries for
oss-cn-hangzhou-internal.aliyuncs.comto the inbound endpoint service IP addresses. In Recursive Resolution Service, add a forwarding rule with these settings: Associated Resolution Cluster: your Hybrid DNS cluster; Forwarding Policy: Forward Only; Request Source: Global Default; Destination Server List: the inbound endpoint service IP addresses. -
On a device in your on-premises network, run
dig test.oss-cn-hangzhou-internal.aliyuncs.comto verify the resolution.