In multi-cloud or hybrid cloud architectures, resolving domain names between environments is often required. This topic shows how to enable cross-environment service access through DNS, assuming you have already established network connectivity using an Express Connect circuit or an IPsec-VPN.
Prerequisites
Your environments are interconnected through a IPsec-VPN or an Express Connect circuit. For more information, see IPsec-VPN User Guide.
Architecture
Expected outcomes
Access
app.example.comfrom an ECS instance, and the DNS query is forwarded to an external DNS server through an outbound endpoint in the VPC.Access
test.oss-cn-hangzhou-internal.aliyuncs.comfrom your on-premises data center or another cloud environment. Your local DNS service forwards the query to Alibaba Cloud Private Zone through an inbound endpoint.Notetest.oss-cn-hangzhou-internal.aliyuncs.comis the domain name for a sample OSS bucket for demonstration purpose. Replace it with the domain name of your actual Alibaba Cloud resource.
Procedure
Case 1: Access an on-premises domain from Alibaba Cloud
Create an outbound endpoint with the IP addresses
192.168.100.74and192.168.192.219.
Create a forward rule. Specify the target domain name (
example.comin this example) and the IP addresses of the external DNS servers (192.168.100.100and192.168.100.200in this example).
ImportantIf
example.comis already configured as a private private zone, enable the recursive resolution proxy for subdomains.Add the VPC of the ECS instance as a scope for the forwarding rule. For more information, see Associate a scope with a rule.
On the ECS instance, run
dig app.example.comto test the solution.
Case 2: Access an Alibaba Cloud domain from on-premises
Add an inbound endpoint with the IP addresses
192.168.0.176and192.168.100.163.WarningThe scope of the private zone for
oss-cn-hangzhou-internal.aliyuncs.commust be set to your VPC. Otherwise, the query fails.ImportantIf your on-premises network conflicts with the default Private Zone IP addresses (
100.100.2.136and100.100.2.138), or if you need to scope DNS resolution to a single VPC, configure custom Private Zone server IP addresses within a VPC.Otherwise, you can use the default addresses for resolution.
On your on-premises DNS server, add a forwarding rule to forward all queries for
oss-cn-hangzhou-internal.aliyuncs.comto the Alibaba Cloud inbound endpoint.On a client in your on-premises network, run the
dig test.oss-cn-hangzhou-internal.aliyuncs.comcommand to verify the resolution.