How does intelligent DNS resolution determine the user's origin?
The core value of intelligent DNS resolution lies in automatically returning the optimal server IP address based on the user's origin. However, an easily overlooked detail is that the authoritative DNS server never sees the user's local machine IP address, but rather the exit IP address of the user-configured LocalDNS (local recursive DNS).
This may sound counterintuitive—why does the DNS server see the LocalDNS's IP address when I'm accessing a website? This relates to the recursive query mechanism of DNS.
I. Why doesn't the authoritative DNS see the "real you"?
When a user enters a domain name into their browser, it first queries the locally configured LocalDNS (such as the ISP's recursive DNS or public DNS). If the LocalDNS doesn't cache the domain, it will query upwards on behalf of the user, level by level: root name server → top-level name server → authoritative DNS server.
In this process, the authoritative DNS server receives the query request from the LocalDNS, not the user's terminal. This means that the source IP address seen by the authoritative DNS is actually the exit IP address of the LocalDNS.
The logic of intelligent DNS is based on this mechanism: determining the visitor's geographical location and ISP type by identifying the exit IP of the LocalDNS—it uses the location of the LocalDNS to approximate the user's location.
II. Three Scenarios: LocalDNS Support for EDNS is a Key Dividing Line
Not all LocalDNSs simply use their own exit IP for queries. Based on the accuracy of the user information obtained by intelligent DNS, there are three scenarios:
Scenario 1: LocalDNS Supports EDNS Client Subnet (ECS)—The Optimal Case
This is the ideal scenario. When LocalDNS supports ECS (RFC 7871 standard), it includes an EDNS extension field in its query to the authoritative DNS, carrying the subnet information of the user's real IP (IPv4 is usually accurate to /24, i.e., the same network segment level).
Intelligent DNS prioritizes reading the IP information in this extension field to determine the user's geographical location, which is more accurate than using the exit IP of the LocalDNS.
The accuracy improvement brought by ECS: Without ECS, users in São Paulo, Brazil, accessing the internet using Google Public DNS (whose PoP node is located in Santiago, Chile) would be misidentified as being in Chile and routed to the wrong CDN node. With ECS enabled, the system can accurately identify that the user is in São Paulo, Brazil, achieving precise and nearby routing.
Scenario Two: LocalDNS Doesn't Support EDNS – A Second-Best Solution
If LocalDNS doesn't support ECS extensions, then Smart DNS has to "take a step back" and use the LocalDNS's exit IP to infer the user's location.
This method has a significant accuracy flaw. For example, a user might be in Shanghai, but the ISP's recursive DNS exit IP is assigned to a city in Jiangsu Province, potentially leading to the user's access being misidentified as being routed to a CDN node in Jiangsu. However, for most ordinary users, the LocalDNS's exit IP and the actual location are usually within the same provincial administrative region, still possessing some reference value.
Scenario 3: LocalDNS Indirectly Supports EDNS – A Special Case
Another scenario is where LocalDNS itself doesn't support ECS, but uses a multi-level caching/secondary proxy architecture. After a user request passes through LocalDNS, it's forwarded to another secondary DNS node, which then queries the authoritative DNS. In this case, the intelligent DNS sees the secondary node's exit IP, not the original LocalDNS's IP, resulting in poorer location accuracy.
III. How Does Intelligent DNS Use This Information to Make Scheduling Decisions?
After knowing the user's origin, the intelligent DNS system needs to combine three information dimensions to make decisions:
**IP Geographic Location Database:** A built-in massive IP database determines the location (country, province, city) and carrier type (China Telecom, China Unicom, China Mobile, etc.) of the LocalDNS exit IP within milliseconds.
**Real-time Network Quality Awareness:** Continuously monitors latency and packet loss rates between each node and the user's region, rather than simply allocating based on geographical distance.
**Node Health and Load:** Continuously probes whether each node is available and whether its load is too high; faulty nodes are automatically removed from the scheduling pool.
After combining the above data, the system returns an optimal IP address: Mobile users are prioritized to receive Mobile node IPs, China Telecom users to receive China Telecom node IPs; Beijing users are prioritized to receive North China node IPs; and healthy nodes with good link quality and low load are prioritized.
IV. Limitations of Intelligent DNS Scheduling
While the ECS mechanism solves the user location problem to some extent, it has not become a standard feature of all LocalDNS systems. Privacy concerns (exposing user subnet information to authoritative DNS) and cache bloat (requiring different results to be cached separately for different subnets) are the main obstacles to its widespread adoption. Therefore, in practical applications, location based on the LocalDNS's egress IP remains the most fundamental criterion for intelligent DNS.
Intelligent DNS determines user origin essentially by indirectly identifying the LocalDNS's egress IP. When LocalDNS supports ECS, it can obtain more accurate user subnet information; when it doesn't, it can only use the LocalDNS egress IP for a rough location. Understanding this mechanism explains why intelligent scheduling is sometimes accurate and sometimes off-target—it's not that the system is unintelligent, but rather that the information it can see is inherently limited.
CN
EN