Hello @xihao tang ,
Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.
I understand that you would like to know if there is an Azure service that can publish your domain name and help in geographical routing as follows: when accessing it through the Internet, domestic users visit the DNS server and return the IP address of your domestic server to domestic users but when a foreign user visits, the DNS server returns the IP address of your Hong Kong server to the foreign user.
Azure Traffic manager can help meet your requirements. Azure Traffic Manager is a DNS-based traffic load balancer. This service allows you to distribute traffic to your public facing applications across the global Azure regions based on various routing methods, including geographic routing.
Refer: https://learn.microsoft.com/en-us/azure/traffic-manager/traffic-manager-overview
https://learn.microsoft.com/en-us/azure/traffic-manager/traffic-manager-how-it-works
Here's an overview of the steps you can follow:
- Create two child Traffic Manager profiles, one for domestic users and another for foreign users. Associate the appropriate endpoint with each profile, one for your domestic server and another for your Hong Kong server. Each endpoint should have its own IP address or fully qualified domain name (FQDN). Define the Geo-mapping for geographic routing within each profile.
- Create a main/parent Traffic Manager profile with geographic routing. This allows you to define different profiles based on user location.
- Add the 2 child profiles (created above) as nested endpoints to this parent Traffic Manager profile and define the Geo-mapping.
- Update the DNS records in your DNS provider to point to the Traffic Manager DNS name. This ensures that when users query your domain name, the DNS server returns the appropriate IP address based on their geographic location.
https://learn.microsoft.com/en-us/azure/traffic-manager/traffic-manager-nested-profiles
https://learn.microsoft.com/en-us/azure/traffic-manager/traffic-manager-point-internet-domain
Additional Information:
If you want to point your root/apex domain to Traffic manager, you can make use of Azure DNS alias records.
But to do this, you should delegate your domain to Azure DNS:
https://learn.microsoft.com/en-us/azure/dns/dns-domain-delegation
https://learn.microsoft.com/en-us/azure/dns/dns-delegate-domain-azure-dns
Kindly let us know if the above helps or you need further assistance on this issue.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.