Help Center/ Domain Name Service/ FAQs/ Private Zones/ How Can I Use a Private Domain Name to Route Internet Traffic?
Updated on 2023-12-18 GMT+08:00

How Can I Use a Private Domain Name to Route Internet Traffic?

You can use a domain name to route traffic over the Internet or within VPCs.

Private DNS translates domain names in VPCs and forward DNS queries for public domain names to public DNS servers. The following describes how an ECS accesses a website using a domain name.

  • If the domain name is a private domain name you configure on the DNS console or is the domain name of a cloud service, private DNS directly returns the mapped IP address.
  • If the domain name has been registered with a domain name registrar, private DNS forwards the request to a public DNS server (for example, 114.114.114.114) and then returns the mapped IP address to the ECS.

If the public domain name is the same as the private domain name, requests to the public domain name will be handled by a private DNS server. If no IP address is found, private DNS will return a message indicating that no record was found and will not forward the request to the public DNS server.

To address this issue, you can use a subdomain of the public domain name as the private domain name and add record sets for the subdomain.

If the public domain name is example.com, create a private zone for subdomain 123.example.com and configure record sets for 123.example.com. In this way, requests to 123.example.com and all its subdomains (*.123.example.com) are processed by the private DNS server, and requests to example.com and other subdomains are forwarded to the public DNS server.

  • If Huawei Cloud DNS is used for domain name resolution over public networks, you can create a public zone example.com and add record sets for it. For details, see Routing Internet Traffic to a Website.
  • If you select another DNS service provider, see the help documentation of that provider.
  • For details about how to configure a private zone for subdomain 123.example.com on the DNS console, see Routing Traffic Within VPCs.