When a browser goes through an HTTP or SOCKS5h proxy, it never resolves the site’s name itself. It hands the name to the proxy, and the name gets resolved at the exit — on whatever phone, router or rack box the provider is renting out that minute. That’s called remote DNS, and it has been a useful tell for a long time: the usual check looks at which resolver asked your nameserver about a name only this session knows, and asks whether that resolver sits anywhere near the browser. A Berlin browser whose lookup came from a Comcast resolver in Ohio is not resolving for itself.

That check has an honest weakness. It reads where the lookup came from, and “where” is mush. Half the internet resolves through Google or Cloudflare from anycast addresses that say nothing about geography, and the half that doesn’t uses ISP resolvers whose location you’re guessing at from an ASN. You end up drawing a line through noise.

So I asked a different question. Not where was this name resolved, but was it resolved at all — or was the answer already sitting in a cache that I had put it in.

Step zero: do exits even cache?

Before building anything, I needed to know whether the exits of a residential pool keep DNS answers at all. If every lookup goes fresh to the authoritative server, there’s nothing to plant.

The test is small. I run the authoritative nameserver for a zone of my own, and a tiny HTTP server — call it the clock — that every name in the zone points to. A name in that zone gets its answer held for 400 ms before the nameserver replies, and the reply carries a TTL of a day. Then, through one sticky session of a proxy, I fetch the same fresh name twice on two separate connections:

request 1   exit resolves k3f9a2-d400.cachehit.example.com → my NS holds 400 ms → exit dials the clock
request 2   same name, new connection: a caching exit dials at once, and my NS hears nothing

The nameserver keeps every lookup in memory, so the reading doesn’t depend on timing at all: the first request leaves one held lookup in the log, and a second request that leaves none was answered from a cache somewhere between the exit and me. The timing agrees when you look — the repeat reaches the clock about the length of the hold sooner — but the log is the ground truth.

The answer, through a commercial US residential pool: yes. Exits cache. Some resolve through their ISP’s resolver, some through Cloudflare’s or Google’s egress, and the repeat of a fresh name very often never reaches me.

That’s interesting on its own, but it isn’t a detection. That probe runs on my machine, through a proxy I bought. A visitor’s browser on a customer’s page is a different story — and the held answer is exactly the wrong tool there. To see a 400 ms hold from inside a page, you’d have to read DNS timing out of the browser’s Resource Timing, fight cross-origin redaction, and then separate 400 ms from residential latency that wanders by hundreds of milliseconds on its own. I’ve done enough of that to know how it ends.

A name that only exists for one exit

Here’s the move. Give every exit address its own name, and make it the same name for everyone who arrives from that address.

token = base32(hmac_sha256(key, b"cachehit-token-v1" + packed(socket_ip)))[:16]
# → "ypffs5sifoasdlnl", and the name is ypffs5sifoasdlnl.cachehit.example.com

A small token app hands it out at GET /get-token. The address is the socket’s peer — never a forwarded header, because whoever sits in the path writes those — so through a proxy it’s the exit. The HMAC makes it opaque: a passive-DNS feed or the proxy itself sees a label it can’t turn back into the address or compute for another one.

Now there are two parties, and they never talk to each other:

warm — me, through the proxy session:
  GET <token app>/get-token            → the exit's token
  GET http://<token>.cachehit.example.com/
                                       → the exit resolves it; my NS answers with a day's TTL;
                                         the answer now sits in the exit's cache

visit — someone's browser on a customer page:
  GET <token app>/get-token?no-cache   → the same token, because it's the same exit
  GET http://<token>.cachehit.example.com/
                                       → resolved now, or already cached?

If the visitor’s browser sits behind that exit with remote DNS, its name is resolved by the exit’s resolver — the one I just filled. The answer comes out of the cache, the browser connects to the clock, and my nameserver never sees a query. If the visitor resolves for itself, the query reaches me.

The /get-token request goes to the token app by IP address, not by name, so it costs no lookup. Through a proxy it does double duty: it’s also the request that picks and pins the session’s peer before anything is measured.

Why there’s no timer

The verdict is one bit: did a lookup of this name reach my nameserver between the moment I handed out the token and the moment the fetch arrived?

Both ends of that window are on my side. The window opens when the token is issued, which is before anyone can ask for the name on this visit’s behalf. It closes when the fetch reaches the clock, and the fetch can only follow the name’s resolution: a browser can’t connect to an address it hasn’t got. So there’s no timeout to tune, no clock to sync, and nothing the browser measures or reports. Like the STUN probe , the trick is to be the server the browser has to talk to and trust only what arrives at my own sockets — here, a DNS query that either came or didn’t.

The delay I started with is gone too. It only ever existed to make a lookup visible inside the browser’s timing. Nobody reads the browser’s timing any more, so the nameserver answers token names instantly.

Three small servers and a Redis

The implementation is three processes on one host, sharing a Redis. The interesting part is the order of writes, because that’s what lets the reading skip timestamps entirely:

token app   GET /get-token        mint the token, then — in one transaction — record the issue
                                  and DELETE the token's last-answer key. ?no-cache (a visitor)
                                  also sets nocache:<token> for 60 s. Only then answer.
nameserver  <token>.<zone> A?     TTL 0 while nocache:<token> is set, a day otherwise.
                                  Write answered:<token> BEFORE the reply leaves. Then publish it.
clock       GET <token>.<zone>    the fetch: is answered:<token> there or not?
                                  Write the verdict, publish it, then answer the fetch.

The issue clears the answer, so any answer found later came after the issue. The nameserver records before it replies, so the record exists before the exit even has the address. The clock reads on arrival, which can only follow the reply. Three writes in an order that can’t be violated, and the question “did a lookup land in the window” becomes “does this key exist.”

Two failure rules follow from that. If Redis can’t take the issue, the token app answers 503 — never a token nobody recorded. If the nameserver can’t record an answer, it doesn’t answer: the resolver retries or gives up, and a lookup nobody wrote down can never read as a cache hit. Pub/sub is only for watching it live; nothing that decides reads it, because a message nobody was subscribed for is simply gone.

The returning visitor

There’s an obvious false positive hiding in this. An ordinary person on their own connection visits, their resolver looks the name up, and my nameserver answers with — what TTL? If it’s a day, their resolver keeps it, and when they come back tomorrow there’s no query: a cache hit, on a person who’s never been near a proxy.

Two guards, because each one leaks on its own.

The visitor’s lookup is answered with TTL 0. That’s what the ?no-cache flag is for: for a minute after a visitor asks for a token, the nameserver answers that token’s name with a TTL of zero. A resolver that honours it keeps nothing, so the next visit resolves again. My warms ask without the flag and get the long TTL. Same name, two TTLs, decided per query by who asked for the token last.

A hit only counts on an exit I warmed. When my own warm’s fetch reaches the clock from the token’s address, it records warmed:<token> with the token’s TTL as its expiry, the way the exit’s cache should forget it. A hit on an exit I never warmed reads as cached-unwarmed, and concludes nothing.

The verdicts, in order of precedence:

verdictmeaning
other-exitthe fetch came from a different address than the token’s — a rotating pool; says nothing
warmmy own fetch, issued without no-cache — it either filled the cache or found it still full
resolveda lookup reached me since the issue: resolved for this visit
remote-dnsno lookup, and I warmed this exit within the TTL: answered from the exit’s cache
cached-unwarmedno lookup, but I never warmed this exit: somebody’s own cache, ignored

I wasn’t sure the second guard would earn its keep. The controls answered that.

What it caught

I deployed the three servers on a small box with the zone delegated to it, and ran everything through one large provider’s US residential pool, each test on a fresh sticky session — a fresh exit.

exitsvisitsresult
warmed, then visited 2–7 s later488 / 8 remote-dns
one exit, warmed once, visited repeatedly11717 / 17 remote-dns over 2½ minutes, from a single DNS answer
never warmed, visited twice48first visit resolved every time; repeat: 2 resolved, 2 cached-unwarmed

(An earlier run of the same protocol, before it moved onto Redis: 11 of 11 visits after a warm were remote-dns, the longest gap 92 seconds.)

Every warm produced exactly one burst of lookups at my nameserver — sometimes one query, sometimes six, when an exit’s forwarder fanned the question out to several upstreams. Every visit after it produced nothing. Not an A, not an AAAA. The exits sat behind a different resolver each time — big US cable and fibre ISPs’ own, a few through Cloudflare’s egress — so this isn’t one provider’s gateway caching on everyone’s behalf. It’s the exits.

The controls are the part I’d show anyone who doubts it. On a never-warmed exit, the first visit was always resolved, answered with TTL 0. On two of the four, the repeat resolved again: TTL 0 did its job and nothing was kept. On the other two, the repeat was a hit anyway. Something on those exits keeps a TTL-0 answer regardless — a forwarder with a floor, an OS cache, a router. My own laptop’s network path did the same thing when I tested it directly. With TTL 0 as the only guard, that’s two false remote-dns out of four. With the warm guard on top, they read cached-unwarmed, and none of the eight control visits came anywhere near a proxy verdict.

Browsers add their own layer on top: a browser’s host cache can keep a name for about a minute regardless of the TTL the resolver passed along. Same lesson. TTL 0 cuts the false positives down; it doesn’t get rid of them.

Where it runs out

Now the part I’d want to read first if someone else had written this.

It confirms exits, it doesn’t discover them. A hit means “this address’s cache holds a name I put there.” I can only put names into exits I can reach, so coverage is exactly the share of the pool I keep warm. It tells you an address you already suspected is doing remote DNS right now, as opposed to having once appeared on a list — a liveness fact, not a discovery method.

Nobody knows yet how long a warm lives, and that decides whether any of this scales. The longest gap I measured is two and a half minutes. If an exit holds the name for hours, keeping a pool warm is cheap: about a kilobyte of proxy traffic per exit every few hours. If resolvers cut long TTLs down to minutes — and many cap them somewhere — you’re re-warming constantly, and the question becomes bandwidth. That’s the next measurement: warm a few dozen exits and come back after ten minutes, an hour, six hours.

A shared cache isn’t always a proxy. The token is keyed to an address, and an address isn’t a person. On a home exit, everyone in that household shares the router and its cache. Behind a mobile carrier’s NAT, thousands of strangers share one public address and the carrier’s resolver — and one of my control exits sat on a mobile carrier, where that’s the norm. If I warm such an exit, an innocent subscriber behind the same NAT gets the same token, asks the same carrier resolver, and lands a hit. Their DNS isn’t remote at all; it’s just shared with a device that’s renting itself out. What the hit honestly says is your connection resolves through the same cache as a proxy exit on your address. For a CGNAT address that is a statement about the address, not the person, and it should be weighted that way.

Resolver farms miss. A resolver service that runs many backends with separate caches can answer the visit from a backend my warm never touched. When I tested from a datacenter, the repeat lookup came in from a different egress address than the first, and missed. That’s a false negative, which is the safe direction: it reads resolved, never a false remote-dns.

It’s evadable by anyone who knows. A proxy operator who reads this can stop caching my zone, or have the exit query my nameserver itself between issue and fetch. Either one turns every hit into resolved. It works because nobody is looking for it yet — the same is true of most signals in this space, and the honest thing is to say so.

It needs TLS before it can run on a real page. Customer sites are HTTPS, and a browser blocks a plain-HTTP fetch from an HTTPS page as mixed content. The token app and the clock need certificates — the clock a wildcard for the zone, which means serving ACME DNS-01 records from the same nameserver. Until then the browser side has only run from my own client doing exactly what a page would: fetch the token, fetch the name.

The honest version

So: a remote-DNS check that doesn’t care where the resolver is, doesn’t read a single timing, and doesn’t trust anything the browser says. It plants a name in an exit’s cache through the front door and watches whether the next visitor through that exit brings it back. Through a real commercial pool, every visit to a warmed exit came back as a cache hit, without one query reaching my nameserver, and none of the never-warmed controls were mistaken for a proxy.

It’s a narrow signal. It speaks only about exits I’ve warmed, it can’t tell a renter from the neighbour sharing their NAT, and it lasts exactly as long as somebody’s cache does. Laid next to the others — the TCP stack under the connection, the TLS behaviour, the address’s history — it’s one more fact I observed rather than one the client reported. And it’s the kind I like best: the only thing it claims is that a packet didn’t arrive, and that’s something I can check for myself.