# Protocol: Where proxy clients resolve DNS

Slug: `proxy-dns-lookup-path-3day`  
Question: for the same destinations, where does DNS resolve — on the VM (SOCKS5), at the proxy (SOCKS5h), or via HTTP CONNECT — and does the destination name leak to the cloud resolver before the proxy?

Day 0 is 2026-11-28. The hostname list is fixed before any proxy probe. The timestamp of the freeze is recorded in `hosts.frozen.json`. This file is not edited to match later results.

## What this study is not

- Not a browser crawl, and not a WebRTC study.
- Not a multi-country exit survey. One residential credential bundle is reused. Exit geography is not a measured outcome.
- Not a stickiness study. Continuity is not scored.
- Not a VPN-tunnel study. No tunnel interface is opened.
- Not a repeat of the proxy-auth header study or the IPv6-under-IPv4-proxy study. Those asked where credentials and IPv6 addresses appear. This one asks which resolver learns the destination name.

## Schedule

Collection starts 2026-11-28. Stop after `2026-11-30T18:30:00Z`. The research article and the site page are written after that stop. A slot that is not collected inside its window is missed. It is not backfilled.

| Slot id | Window (UTC) |
| --- | --- |
| `20261128-immediate` | `2026-11-28T00:00:00Z`–`2026-11-28T17:50:00Z` |
| `20261128T1800Z` | `2026-11-28T17:50:00Z`–`2026-11-28T18:45:00Z` |
| `20261129T0600Z` | `2026-11-29T05:50:00Z`–`2026-11-29T06:45:00Z` |
| `20261129T1800Z` | `2026-11-29T17:50:00Z`–`2026-11-29T18:45:00Z` |
| `20261130T0600Z` | `2026-11-30T05:50:00Z`–`2026-11-30T06:45:00Z` |
| `20261130T1800Z` | `2026-11-30T17:50:00Z`–`2026-11-30T18:30:00Z` |

## Vantage and conditions

USA Cursor cloud agent. Four conditions, same six hostnames, same order every slot. Each probe is a fresh process.

| Order | Condition | What the client does |
| --- | --- | --- |
| 1 | `cloud-direct` | Resolve on the VM with `getaddrinfo`, then TCP/TLS to the resulting IPv4. No proxy. Process proxy environment variables are removed. |
| 2 | `socks5` | Resolve on the VM with `getaddrinfo`, then SOCKS5 CONNECT using address type IPv4. The hostname is not sent in the SOCKS request. |
| 3 | `socks5h` | No local `getaddrinfo` of the destination. SOCKS5 CONNECT uses address type domain (the hostname). |
| 4 | `http-connect` | No local `getaddrinfo` of the destination. HTTP `CONNECT hostname:443` with `Proxy-Authorization` on the proxy hop only. |

Residential SOCKS and HTTP use one ProxySeller credential bundle from `PROXYSELLER_HOST`, `PROXYSELLER_HTTP_PORT`, `PROXYSELLER_SOCKS_PORT`, `PROXYSELLER_USER`, and `PROXYSELLER_PASS`. The proxy hostname is resolved once, before the capture window, and the probe then connects to that address. Session mode is **reuse injected credentials**. No session-id suffix, no country rotation, no second residential product.

If the bundle is missing, proxy conditions are `not_run` and `cloud-direct` still runs.

## Fixed hostnames

Chosen before any probe. Not replaced if one of them fails. Cap is 6.

| Hostname | Role |
| --- | --- |
| `example.com` | Stable IPv4 name |
| `iana.org` | Stable organisation name |
| `www.wikipedia.org` | CDN name whose address set can depend on the resolver |
| `cloudflare.com` | Anycast name |
| `dns.google` | Anycast resolver name |
| `one.one.one.one` | Anycast resolver name |

## How a lookup is observed

`nsswitch.conf` on this image resolves `hosts` with `files dns`. `/etc/resolv.conf` points at a non-loopback private nameserver. That nameserver is the cloud resolver for this VM. Its address is stored only as a salted hash and an address class (`private`, `global`, and so on). nscd is not running (`/var/run/nscd/socket` is absent).

Each probe is a new Python process. Two instruments run together:

1. `LD_PRELOAD` of `scripts/dnsleak_preload.c` logs `getaddrinfo` names. That is the process-level lookup. glibc sends the actual DNS message with an internal `sendmmsg` on a connected UDP socket, which a preload on the public `sendmmsg` symbol does not see.
2. `strace -f -tt` records `connect`, `sendmmsg`, `sendto`, `sendmsg`, `recvfrom`, and `recvmsg` for that process. A socket connected to port 53 on a `resolv.conf` nameserver, or a `recvfrom` from that nameserver, is a cloud-resolver exchange. Question names and answer addresses are parsed from those payloads. The strace file is mode `0600` under `private/`, parsed in memory, and deleted. It is never committed. `send` and `recv` are not traced, so proxy authentication bytes are not in the file.

The positive control is condition `cloud-direct`: every hostname must produce at least one exchange with the configured nameserver. If that control fails, the slot is monitor-blind and a “no leak” reading is not evidence.

A destination name **leaked before the proxy** when a DNS query for that exact name was sent to the configured nameserver before the proxy TCP connection started (`MARK proxy-connect-start`). Queries for the proxy’s own name are outside the window and do not count. TLS SNI is not a DNS lookup. It is the name on the handshake after the tunnel exists.

`connection_used_resolver` is `cloud-system` when the bytes sent toward the destination were an address taken from that VM lookup (direct TCP or SOCKS5 address type IPv4). It is `proxy` when the client sent only the hostname (SOCKS5 domain or HTTP CONNECT) and the proxy completed the connect. The proxy’s own recursive resolver address is not on the VM’s wire. A successful remote connect shows that resolution happened at the proxy; it does not name the proxy’s upstream server.

SOCKS bind addresses are hashed. They count as the same answer as the cloud resolver only when the bind address is a global address and its hash is in the cloud A set. An unspecified or private bind address is not treated as the destination.

After the tunnel or direct TCP connect, the probe performs one TLS handshake with `server_hostname` set to the destination and the default public trust store. No HTTP body is downloaded. Certificate failure is recorded separately from DNS.

## Client limits that are part of the method

- Connect timeout 10 seconds. One attempt. No retry and no extra hostname.
- SOCKS authentication is the username/password method. HTTP authentication is `Proxy-Authorization: Basic` on the CONNECT request only.
- Values are read from the environment inside the process. They are not placed on argv.
- User-Agent is sent only on the HTTP CONNECT request to the proxy: `FreePolicyToolsResearch/1.0 (+https://freepolicytools.com/; proxy-dns-lookup-path-3day)`.

## Scoring

Per probe:

| Field | Meaning |
| --- | --- |
| `looked_up_on_vm` | `getaddrinfo` or a DNS query for the destination ran in the probe process |
| `query_sent_to_cloud_resolver` | A query for the destination was sent to a `resolv.conf` nameserver |
| `leak_before_proxy` | That query happened before the proxy connection. Null on `cloud-direct` |
| `resolution_locus` | `vm`, `proxy`, `vm-and-proxy`, `unobserved`, or `not_run` |
| `resolver_answered` | `cloud-system` when a response arrived from the configured nameserver; `proxy` when only the proxy completed a hostname connect; otherwise `none` |
| `connection_used_resolver` | Which answer the connect actually used: `cloud-system`, `proxy`, or `unobserved` |
| `answer_matches_cloud_direct` | SOCKS5 A-set hash equals the same slot’s direct A-set hash |
| `positive_control_ok` | Every direct probe sent a query to the configured nameserver |

The article’s primary contrast is `leak_before_proxy` and `connection_used_resolver` across `socks5`, `socks5h`, and `http-connect`, with `cloud-direct` as the named cloud resolver baseline.

## Redaction

Committed files must not contain the proxy host, username, password, Proxy-Authorization material, Basic tokens, raw IP addresses, or the proxy ports. The collector scans evidence, the freeze file, and the public mirror before they are written. `private/` is gitignored. Salt for address hashes stays in `private/ip-salt.txt`.

## Limits known at freeze

- One Python client implementing the three proxy semantics, instrumented with a libc preload. This is not a survey of browsers or of curl versions.
- `getaddrinfo` is observed by the preload. The DNS message itself is observed by strace of the probe process, not by a NIC capture. A resolver the probe did not reach through port 53 on the configured nameserver would fail the positive control rather than count as a silent pass.
- glibc on this image has no success cache. Each local resolve is expected to transmit a new query even if the recursive resolver answers from its cache. The packet to the cloud nameserver is the leak, not a cache hit inside that nameserver.
- Remote resolution is inferred from “hostname sent, no local query, proxy connect succeeded.” The proxy’s upstream resolver IP is not visible.
- TLS proves the peer presented a publicly trusted certificate for the name. It does not list which address the proxy selected when several A records exist.
- One cloud VM, one residential credential bundle, six names, six slots. A slot is a diary point.
- No HTTP body, no browser, no WebRTC, no second country.

The article after the last slot may link `/proxyseller/` with a disclosure if these residential paths carried the measurements. That link is not part of the measurement.
