What is intelligent DNS resolution? How does weighted resolution work?
Many people first encounter "Smart DNS" when facing a common problem: despite having high-quality server configurations and sufficient bandwidth, access speeds vary drastically for users across different regions and internet service providers (ISPs). The answer often lies not with the server itself, but at the domain name resolution stage.
Traditional DNS returns the same IP address to every user; whether you are a China Telecom or China Unicom subscriber, or located in China or the United States, the result is identical. This result might yield fast speeds for some users while being slow for others. Smart DNS aims to ensure that users from different sources receive the IP address best suited to their specific circumstances.
The core logic of Smart DNS: Tailoring the response to the user
The "smart" aspect of Smart DNS lies in the fact that it no longer treats all query requests the same way. When a user's local DNS server sends a query to the Smart DNS, the system identifies the request's source characteristics—typically determining the user's ISP and geographic location based on the IP address of the local DNS server initiating the query.
Once it identifies the user—for instance, as a Beijing Telecom subscriber or a Guangdong Mobile subscriber—Smart DNS does not return a static IP. Instead, it selects an IP address from a pre-configured pool that matches the user's profile. Telecom users receive an IP for a Telecom data center, Unicom users get one for a Unicom data center, and US users get an IP for a US-based node.
Fundamentally, this process transforms the "domain-to-IP" mapping from a fixed one-to-one relationship into a conditional one-to-many mapping. A single domain name can resolve to completely different server addresses depending on where the visitor is coming from.
Internally, a Smart DNS system typically maintains multiple address tables: one for Telecom IPs, one for Unicom IPs, one for Mobile IPs, and potentially others categorized by province or country. Each table corresponds to a specific server IP or group of IPs. When a query request arrives, the system compares the local DNS server's IP against these tables; upon finding a match, it returns the server address associated with that specific table. Route-based Resolution: Addressing the "Which Server?" Question
Route-based resolution is the most fundamental and commonly used feature of intelligent DNS.
Its logic is straightforward: it directs users to the most suitable server based on their ISP or geographic location.
A typical use case involves cross-ISP access. If your service deploys servers for both China Telecom and China Unicom, route-based resolution ensures that Telecom users resolve to a Telecom IP address, while Unicom users resolve to a Unicom IP address. Users do not need to manually select a route; the DNS layer makes that decision for them.
For users in mainland China, configurations can be set up for specific ISPs—such as China Telecom, China Unicom, China Mobile, and the Education Network. The system intelligently determines the user's access source and returns the corresponding IP address, enabling access via the nearest or most appropriate server.
Route-based resolution answers the question: "Which server should this user go to?" It performs "route selection" by funneling users from different sources into different "gateways," with each gateway leading to a set of servers optimized for that specific source.
Weighted Resolution: Addressing the "How to Distribute Traffic?" Question
Weighted resolution addresses a different type of issue.
Suppose you have configured a server for a specific route, but business growth renders a single server insufficient, prompting you to add another. The two servers may not have identical specifications: one might offer superior performance and higher bandwidth, while the other serves as a backup or has lower specifications. You want the majority of traffic directed to the high-performance server and a smaller portion to the other.
This is where weighted resolution comes into play.
It works by configuring multiple IP addresses for the same host record and route, assigning a specific weight value to each IP. When responding to a query, the DNS server randomly selects and returns one of the IP addresses based on the assigned weight ratios. Weight values can typically be set between 0 and 100, with a default ratio of 1:1. If you set the weight for Server A to 3 and Server B to 1, the probability of a DNS query returning Server A is approximately 75%, while the probability for Server B is about 25%. For each query, the system randomly selects and returns a single record based on these weights, rather than returning all of them.
Weighted resolution addresses the question: "What proportion of traffic should be allocated to this server versus another?" Its function is "traffic splitting"—distributing traffic within a specific network path across different physical servers according to defined ratios.
Combining Network-Based and Weighted Resolution: A Complete Scheduling Strategy
Network-based resolution and weighted resolution are not mutually exclusive; they can be combined to achieve more granular traffic management.
A typical scenario for this combination is as follows:
You have deployed two servers in Beijing, with Server A performing three times as fast as Server B. You want users on the Beijing Telecom network to access both servers, but with traffic distributed at a 3:1 ratio.
This is achieved in two steps:
Step 1: Use network-based resolution to create a "Beijing Telecom" route. This ensures that only users on the Beijing Telecom network are directed to these two servers.
Step 2: Add two "A records" under this route—pointing to the IP addresses of Server A and Server B, respectively—and set their weights to 3 and 1. This ensures that users entering via this route are distributed between the two servers according to the 3:1 ratio.
Network-based resolution determines "who enters the pool," while weighted resolution determines "how traffic is distributed within the pool." Combining the two creates a complete workflow, spanning everything from "user source identification" to "final server allocation."
FAQs
Q: How exactly do I configure the weight values for weighted DNS resolution?
Weight values can typically be set between 0 and 100, with a default ratio of 1:1. Configuration is based on ratios rather than absolute values. For example, if you want a 3:1 distribution, you can set the weights to 3 and 1; setting them to 6 and 2 yields the same result. If a record's weight is set to 0, that record will not be returned during resolution; if all records are set to 0, all record values will be returned.
Q: Does weighted DNS resolution support "session persistence" (ensuring the same user always accesses the same server)?
No. With weighted resolution, a record value is selected randomly based on weight for each DNS query; the same user might receive different IP addresses when querying at different times. The DNS layer does not maintain a binding relationship between users and servers. If session persistence is required, it must be implemented at the application layer (e.g., via a load balancer or the application's own session management).
Q: What criteria are used to define the "lines" (network paths) in line-based DNS resolution?
There are two common classification criteria: ISP (Internet Service Provider) and geography. The ISP dimension distinguishes between providers such as China Telecom, China Unicom, China Mobile, and the Education Network (CERNET); the geographic dimension allows for classification by province, country, or custom network segments.
Q: What is the difference between weighted DNS resolution and standard DNS round-robin?
Standard round-robin distributes traffic evenly, meaning every IP address has an equal probability of being selected. Weighted resolution distributes traffic proportionally, allowing you to control the volume of traffic each server receives. Weighted resolution is a more suitable choice than round-robin when you have servers with varying performance capabilities.
Q: Will the resolution results from intelligent DNS be cached by local DNS servers?
Yes. The results returned by intelligent DNS will be cached by the user's local DNS server for a certain period (determined by the TTL value). Before the TTL expires, users served by the same local DNS server will receive the same result. This means that adjustments to traffic routing do not take effect immediately; one must wait for the cache to expire. If an urgent traffic switch is required, the TTL should be set to a shorter duration.
CN
EN