In the globalized internet landscape, more and more websites and businesses are serving users both in mainland China and overseas. However, due to network structure, export bandwidth, policy restrictions, and unstable cross-border links, users in different regions often experience significant speed differences when accessing the same server. Many webmasters have found that while their websites load quickly overseas, mainland Chinese users experience high latency and slow loading times. Conversely, when their websites are hosted on domestic servers, access from overseas users is extremely unstable. To ensure a balanced user experience for both Chinese and international users, one of the most effective solutions is DNS smart resolution and traffic diversion.
DNS is a system that converts domain names into IP addresses. When a user accesses a website, they first need to obtain the server address through DNS resolution before a connection can be established. Traditional DNS uses a fixed resolution method, meaning that all users requesting the same domain name return the same IP address. However, in cross-regional deployments, this approach fails to provide the optimal node based on the visitor's location, easily leading to "nearest access" failures. For example, if a Chinese user is resolved to a US server, access speeds will inevitably decrease. The core function of DNS smart resolution is to automatically assign different IP addresses based on the user's location, carrier type, or network region, achieving both Chinese and international traffic diversion and nearest access.
Smart DNS resolution typically relies on two technologies: geolocation and intelligent route allocation. GeoDNS identifies the region of a user's DNS request by determining the source IP address, thereby returning the nearest or optimal server address. Intelligent route allocation is often used to set independent resolution policies for different carriers (such as China Telecom, China Unicom, and China Mobile) or different countries (such as China, the United States, and Japan). For example, users in mainland China can be directed to a domestic server, while users overseas can be directed to a server in Singapore or the United States, thus achieving automatic traffic diversion.
To build a smart DNS traffic diversion system, choose a DNS hosting service provider with global nodes. These platforms typically support features such as intelligent resolution, latency detection, health checks, and weight allocation, allowing for flexible regional access control. The following describes several common scenarios.
The first step is to prepare multiple server nodes. If your business primarily serves users in China and overseas, you can deploy a domestic primary node in mainland China (such as Beijing or Guangzhou) and overseas nodes in Hong Kong, Japan, or Singapore. If your business targets Europe and the United States, you can also add nodes in Los Angeles, USA, or Frankfurt, Germany.
The second step is to configure the DNS smart resolution rules. Taking DNSPod as an example, you can create multiple A records in the console:
- Domestic lines (China Telecom, China Unicom, China Mobile) → resolve to a domestic IP address, such as 123.123.1.1;
- Default lines (overseas or unidentified areas) → resolve to a Singapore IP address, such as 103.22.4.1.
This way, when Chinese users access the service through a local carrier, they automatically receive a domestic server IP address. Overseas users, on the other hand, receive a Singapore server IP address, effectively dividing traffic between China and other countries.
For international platforms, this can be achieved through geo-location routing strategies. For example, in Route53, create multiple record sets for the same domain name, selecting different geolocation options:
- Region: China → Points to a domestic node
- Region: Asia (excluding China) → Points to a Singapore node
- Region: North America → Points to a US node
When a DNS request arrives, the system returns the appropriate resolution result based on the requester's IP address's geographic location.
For websites with high traffic, a health check mechanism can also be incorporated. If a regional node fails, DNS automatically switches to a backup node to ensure uninterrupted access. For example, if the Singapore node is unavailable, overseas access automatically switches to the Japan node. If a domestic node fails, resolution can temporarily redirect to the Hong Kong or Shenzhen node. This automatic disaster recovery capability significantly improves website stability.
In a traffic distribution architecture, DNS intelligent resolution is only the first step. To achieve true acceleration, CDN acceleration and load balancing are often combined. For example, domestic access can be resolved to a Tencent Cloud or Alibaba Cloud CDN node, while overseas access can be resolved to other nodes. This not only facilitates geographical distribution but also enables static resource caching by CDN edge nodes, ensuring global, local access.
It is important to note that the effective time for DNS intelligent resolution is dependent on caching mechanisms. Because ISPs and browsers cache DNS results, it takes some time (usually several minutes to several hours) for changes in resolution to take effect in all regions. To reduce cache latency, it's recommended to set the TTL value to a short time (e.g., 300 seconds), then adjust it to a longer time after stabilization.
In addition to commercial DNS platforms, you can also implement intelligent traffic diversion by building your own DNS server. Commonly used software includes PowerDNS, GeoDNS, or CoreDNS. These systems support dynamic resolution based on the IP geographic database (GeoIP). For example, in PowerDNS, you can configure:
if client_ip in China:
return A 123.123.1.1
else:
return A 103.22.4.1
However, building your own DNS requires high technical skills and maintenance, making it suitable for large websites or professional teams.
After implementing intelligent DNS offload, monitoring and optimization are still necessary. You can use the dig or nslookup commands to test the resolution results for different regions:
dig @8.8.8.8 example.com
dig @223.5.5.5 example.com
Use both overseas and domestic public DNS to test and confirm that the resolution returns the correct target IP. Also, use Ping and Traceroute tools to test latency and path information to determine if access speed has significantly improved. For security, it's recommended to enable DNSSEC and HTTPS encrypted resolution (DoH, DoT) to prevent DNS hijacking or tampering.
Smart DNS offloading not only solves slow cross-border access but also flexibly accommodates multi-regional deployment scenarios. For example, multilingual websites can resolve to the corresponding language version for each country; global e-commerce platforms can direct users to the nearest payment gateway node; and video or gaming services can assign low-latency servers based on region, significantly improving the user experience.
Smart DNS offloading, which distributes traffic between China and abroad, is an efficient, low-cost, and sustainable cross-border acceleration solution. It dynamically assigns the optimal node based on user location without changing the website architecture, significantly improving access speed and stability. Combined with CDN, caching, load balancing, and security policies, this ensures a consistent website experience globally. For cross-border e-commerce, gaming, media platforms, or multilingual websites, deploying smart DNS resolution is not only crucial for performance optimization but also an indispensable technical foundation for global operations.
CN
EN