How latency-based routing sidesteps the problem
What EDNS Client Subnet actually does at the wire level
- A user at IP 203.0.113.47 asks their recursive resolver to look up
app.example.com. - The recursive resolver constructs a DNS query to the authoritative nameserver for
example.com. If ECS is enabled, it adds an EDNS0 OPT record containing the client's subnet — typically a /24 for IPv4 (so203.0.113.0/24), stripping the last octet for privacy. - The authoritative server receives the query. If it supports ECS, it uses the client subnet (not the resolver's IP) to look up the geographic location and pick the right regional record.
- The authoritative server responds with the DNS answer and includes a
SCOPE PREFIX LENGTHin the ECS response, telling the resolver how broadly it can cache this answer. For example, a scope of /16 means the answer is valid for any client in the203.0.0.0/16range. - The recursive resolver caches the answer, keyed not just by domain name but also by the client subnet prefix. Future queries from a different subnet trigger a new upstream lookup.
Why some resolvers do not send ECS
Diagnosing the problem
CLIENT-SUBNET or ECS field in incoming queries. The exact log format depends on your DNS server software.
From the client side, you can simulate an ECS-aware query using dig (version 9.11 or later supports the +subnet flag):
BASH
dig @8.8.8.8 app.example.com A +subnet=203.0.113.0/24BASH
dig @8.8.8.8 app.example.com ABASH
dig @1.1.1.1 app.example.com A+subnet query, you have confirmed the ECS gap.
