Lead finding
We asked one question: when plaintext DNS is hijacked the way a captive portal hijacks it, does DNS over HTTPS (DoH) still reach the resolver it was pointed at? Over 15 scheduled slots between 2026-11-24T13:16:12Z and 2026-12-01T06:05:09Z, we ran a frozen list of 12 names through four paths: the VM’s system resolver, a loopback UDP hijacker that answered every A query with a documentation address, DoH to Cloudflare by IP literal, and DoH to Google by IP literal.
- Hijack armed: 180 of 180 hijacked
diganswers were the decoy203.0.113.10and nothing else. The hijacker saw exactly 225 queries in total (15 per slot), so nothing else touched it. - DoH by IP escaped: 180 of 180 Cloudflare answers and 180 of 180 Google answers were real, all 360 HTTP responses were status 200, and the decoy appeared in 0 of 360.
- Hostname bootstrap did not: asking the hijacker for
cloudflare-dns.comanddns.googlereturned the decoy in 30 of 30 attempts. - No intermittency: every one of the 15 slots classified
doh_escapesfor both resolvers. - Cost: median 21 ms for the system resolver, 19 ms for Cloudflare DoH and 21 ms for Google DoH, with a fresh HTTPS connection per DoH query.
- Where answers differed: DoH matched the system resolver exactly for nine of twelve names in every slot. All disagreement sat in three CDN-steered names and never involved the decoy.
Scope in one sentence: this is a simulation of the DNS-layer half of a captive portal on loopback, not a field study of a real portal. The limits section says exactly what that does and does not license you to conclude.
For the encrypted-DNS background, read our explainer on HTTPS, secure DNS and DNS over HTTPS. For resolver behavior behind proxies, see the earlier DNS path intermittency diary.
Why this question matters
A captive portal is the gate on hotel, airport, café and campus Wi-Fi. Until you accept terms or sign in, the network answers for you. Two mechanisms do most of the work: it redirects or intercepts web requests, and it rewrites DNS so names resolve to the portal instead of the real site. Operating systems detect portals by fetching small probe URLs and checking whether the response is the one they expect. The probe hostnames for Google, Apple, Mozilla and Microsoft are in our frozen list.
DoH, standardized in RFC 8484, moves lookups inside HTTPS to a resolver the client chose. That is good for confidentiality on a hostile network and it is exactly why it collides with captive portals: if lookups no longer pass through the network’s resolver, the network cannot poison them. The standards-based alternative is explicit signaling. RFC 8910 lets a network advertise its portal API through DHCP or router advertisements.
The question this study isolates is narrow: when system DNS is hijacked, what decides whether DoH still works? Our hypothesis, written into the protocol before any measurement, was that how the DoH client finds its resolver decides it. A resolver addressed by IP literal never needs plaintext DNS. A resolver addressed by hostname does.
What we froze before measuring
We froze the protocol at 2026-11-24T13:16:10Z, two seconds before the first measurement.
- 12 query names, in a fixed order:
example.com,neverssl.com,connectivitycheck.gstatic.com,captive.apple.com,detectportal.firefox.com,www.msftconnecttest.com,cloudflare.com,dns.google,cloudflare-dns.com,one.one.one.one,wikipedia.org,freepolicytools.com. - Four per-name conditions:
baseline-system-dns,captive-hijack-dns,doh-ip-cloudflare,doh-ip-google, plus two per-slot hostname-bootstrap conditions. - The decoy:
203.0.113.10, an address in TEST-NET-3 reserved for documentation by RFC 5737. We never present a live third-party address as a fake portal. - Pre-registered slot codes:
hijack_armed,doh_escapes,doh_partial,doh_blocked,hijack_ineffective,baseline_broken,inconclusive. - A lean rule: at most 12 names and two DoH resolvers, no proxy on diary slots, one optional Day 0 proxy contrast.
The first slot ran seconds after the freeze and the remaining 14 ran at about 06:05 and 18:05 UTC. The cadence was amended once to end at the final slot, 2026-12-01 at 06:05 UTC, and no later slot exists. Measured honestly, the 15 slots span 6 days, 16 hours and 49 minutes (about 160.8 hours), a little short of a literal 168 hours.
Methods
Vantage
Every measurement ran on one Cursor Cloud Agent VM in a USA datacenter using Python 3, dig and the standard library’s HTTPS client. Published rows redact addresses other than the decoy and the two well-known anycast bootstrap addresses to a salted SHA-256 prefix, so the evidence can show whether two answers were the same set without publishing the addresses.
The hijacker
scripts/captive_dns.py is a small UDP DNS server bound to 127.0.0.1 on an ephemeral port. It answers every A query with 203.0.113.10. Nothing in the VM’s networking was reconfigured: the “captive” path is the resolver we explicitly query with dig @127.0.0.1 -p <port>. Each slot starts it fresh, sanity-checks it with an example.com lookup that must return the decoy, and stops it at the end.
The four per-name conditions
- Baseline system DNS:
dig +short +time=3 +tries=2 A <name>against the VM’s default recursive resolver. A non-decoy A record is required. - Captive hijack: the same
digaimed at the loopback hijacker. The decoy is required. - DoH by IP, Cloudflare: an HTTPS GET to
https://1.1.1.1/dns-querywithaccept: application/dns-json. See Cloudflare’s DNS JSON documentation. - DoH by IP, Google: an HTTPS GET to
https://8.8.8.8/resolve. See Google’s DoH JSON API.
The DoH client is Python’s urllib, which verifies certificates by default and opens a new connection for each query. All 360 DoH calls succeeded under default verification, so both IP-literal endpoints presented certificates that validated for their IP names. With no connection reuse, every DoH time includes TCP and TLS setup, which makes the comparison with a single dig datagram conservative for DoH.
Hostname bootstrap checks and the Day 0 proxy contrast
Once per slot we asked the hijacker for cloudflare-dns.com and dns.google, the names a hostname-configured DoH client must resolve first. We also ran DoH to those hostnames over the VM’s normal path to label the contrast: only the loopback resolver was hijacked, so those calls are expected to succeed and show the endpoints were healthy.
On Day 0 only we ran one extra probe: a single Cloudflare DoH-by-IP query for example.com through a ProxySeller HTTP proxy with curl. It is one observation and an anecdote, not a rate.
What the numbers count
Each slot has 12 names times four conditions, which is 48 name-level observations. Fifteen slots give 720. Add 30 hijacked hostname digs, 30 system-path hostname DoH calls, 15 hijacker sanity checks and the one proxy probe, and the study contains 796 measurements.
Results
Slot-level classification
All 15 slots classified doh_escapes for Cloudflare and for Google with the hijack armed. None of the other pre-registered codes occurred and no slot was excluded for a broken baseline.
Per-name outcomes across the week
| Signal | Count | Out of |
|---|---|---|
| Baseline resolved to a real (non-decoy) address | 180 | 180 |
| Hijacked lookup returned only the decoy | 180 | 180 |
| Cloudflare DoH by IP returned a real address | 180 | 180 |
| Google DoH by IP returned a real address | 180 | 180 |
| Decoy present in any DoH answer | 0 | 360 |
| DoH HTTP responses with status 200 | 360 | 360 |
| Hostname lookups poisoned through the hijacker | 30 | 30 |
| Hostname DoH over the system path that worked | 30 | 30 |
Every name behaved the same way. The four captive-probe hostnames, which are the names a real client uses to discover a portal, resolved to real addresses over both DoH endpoints in every slot while the same four names resolved to the decoy through the hijacker.
Latency
All values are milliseconds per query, 180 observations per condition.
| Condition | Min | Median | Mean | P90 | P95 | Max |
|---|---|---|---|---|---|---|
| Baseline system DNS (dig) | 18 | 21 | 22.6 | 29 | 39 | 51 |
| Captive hijack (loopback dig) | 15 | 17 | 17 | 19 | 20 | 22 |
| Cloudflare DoH by IP | 13 | 19 | 21.5 | 33 | 38 | 46 |
| Google DoH by IP | 14 | 21 | 22.2 | 30 | 35 | 52 |
Three things stand out. DoH by IP did not cost anything noticeable: its median is within two milliseconds of the system resolver. The hijacked loopback lookup is the tightest distribution, between 15 and 22 ms, which tells us roughly what the dig process costs on this VM before any network is involved. DoH has the heaviest tail, which is what you expect from opening a TLS connection per query. The system-path DoH calls to the two resolver hostnames had a median of 24 ms (range 17 to 41); the hostname lookups through the hijacker took a median of 17 ms, the same as any other hijacked lookup.
Time of day and drift
Morning slots (06:05 UTC) had medians of 20 / 16 / 18.5 / 21 ms (baseline / hijack / Cloudflare DoH / Google DoH) and evening slots (18:05 UTC) had 21 / 17 / 19 / 21 ms. The Day 0 slot was a little slower on DoH (24 ms Cloudflare, 22.5 ms Google), which may reflect the first run on a fresh process; we did not test that and the difference is a few milliseconds. Per-slot medians stayed inside narrow bands for the whole week with no trend.
The Day 0 proxy contrast
The single ProxySeller probe returned HTTP 200 and two non-decoy addresses, the same two address hashes as the direct-path answer for example.com in that slot. It took 1,122 ms against a 24 ms median for direct Cloudflare DoH in the same slot, about 47 times slower. That is one measurement through curl and a residential proxy hop, so we do not quote the ratio as a rate. It confirms that a DoH-by-IP exchange survives an HTTP proxy hop and shows the order of magnitude a hop adds.
Charts
DoH by IP: real answers versus decoy
360 DoH answers across both resolvers. The decoy slice is zero.
Hostname bootstrap under the hijack
Poisoned through the hijacker 30 of 30; the same hostnames worked over the unhijacked system path 30 of 30.
Latency statistics by condition (ms)
Latency profile radar (ms)
Latency histogram: observations per 5 ms bin
The hijacked loopback lookup sits almost entirely in the 15 to 19 ms bin. DoH spreads further right because each query opens a fresh HTTPS connection.
Per-slot median latency across the week (ms)
Slot labels read day/month and UTC hour. D0 is the first slot after the freeze.
Median latency by name (ms)
example.com is first in the fixed order and freepolicytools.com is last. Order was not randomized, so position and name cannot be separated.
Answer fidelity: did DoH return the same addresses?
The question for a hijack is not only whether DoH answered but whether it answered with real addresses. We compared answer sets, as hashes, between the system resolver and each DoH resolver for every name in every slot.
Agreement with the system resolver (180 comparisons each)
| Comparison | Identical | Partial | No overlap |
|---|---|---|---|
| Cloudflare DoH vs system resolver | 141 | 7 | 32 |
| Google DoH vs system resolver | 136 | 11 | 33 |
The two DoH resolvers shared at least one address with each other in 162 of 180 cases, more than either shared with the system resolver. All disagreement sits in three names and none of it involves the decoy:
- captive.apple.com: the system resolver returned 13 different answer sets across 15 slots, Cloudflare 12 and Google 11. A rotating CDN pool.
- detectportal.firefox.com: baseline and both DoH resolvers never overlapped, but Cloudflare and Google overlapped with each other in 15 of 15. The system resolver returned one family of addresses and the two public resolvers another.
- www.msftconnecttest.com: 10 distinct baseline sets, with Cloudflare overlapping in 12 of 15 slots and Google in 8 of 15.
The other nine names returned an identical address set through all three paths in every slot, and those sets did not change across the week. A plausible reading is that the three names are steered by resolver location or EDNS client-subnet handling, which differs between resolvers, but we did not test the cause so we state it as a pattern. What matters here is the negative: no DoH answer anywhere was the decoy.
Per-name table
| Name | Baseline ms | Hijack ms | CF ms | Google ms | CF = base | Google = base | Base sets |
|---|---|---|---|---|---|---|---|
| example.com | 20 | 17 | 35 | 24 | 15/15 | 15/15 | 1 |
| neverssl.com | 25 | 17 | 18 | 18 | 15/15 | 15/15 | 1 |
| connectivitycheck.gstatic.com | 20 | 17 | 17 | 20 | 15/15 | 15/15 | 1 |
| captive.apple.com | 23 | 17 | 18 | 21 | 0/15 | 0/15 | 13 |
| detectportal.firefox.com | 21 | 17 | 20 | 19 | 0/15 | 0/15 | 3 |
| www.msftconnecttest.com | 22 | 16 | 18 | 20 | 6/15 | 1/15 | 10 |
| cloudflare.com | 20 | 17 | 18 | 23 | 15/15 | 15/15 | 1 |
| dns.google | 20 | 17 | 19 | 18 | 15/15 | 15/15 | 1 |
| cloudflare-dns.com | 20 | 16 | 17 | 22 | 15/15 | 15/15 | 1 |
| one.one.one.one | 20 | 16 | 18 | 22 | 15/15 | 15/15 | 1 |
| wikipedia.org | 20 | 16 | 20 | 21 | 15/15 | 15/15 | 1 |
| freepolicytools.com | 36 | 16 | 29 | 33 | 15/15 | 15/15 | 1 |
Latencies are medians over 15 slots. “= base” counts slots where the DoH answer set was identical to the system resolver’s. “Base sets” is the number of distinct system-resolver answer sets seen for that name.
Slot table
| Slot | Collected (UTC) | Classification | Base | Hijack | CF | |
|---|---|---|---|---|---|---|
20261124-immediate | 2026-11-24T13:16:12Z | doh_escapes | 23 | 18.5 | 24 | 22.5 |
20261124T1800Z | 2026-11-24T18:05:14Z | doh_escapes | 21 | 17 | 18 | 21 |
20261125T0600Z | 2026-11-25T06:05:16Z | doh_escapes | 21 | 16 | 19.5 | 21 |
20261125T1800Z | 2026-11-25T18:05:24Z | doh_escapes | 22.5 | 17 | 20 | 24.5 |
20261126T0600Z | 2026-11-26T06:05:22Z | doh_escapes | 21 | 16 | 20 | 22 |
20261126T1800Z | 2026-11-26T18:05:25Z | doh_escapes | 20 | 17 | 19 | 19.5 |
20261127T0600Z | 2026-11-27T06:05:10Z | doh_escapes | 20 | 16 | 19.5 | 20.5 |
20261127T1800Z | 2026-11-27T18:05:11Z | doh_escapes | 20 | 16.5 | 19.5 | 19.5 |
20261128T0600Z | 2026-11-28T06:05:22Z | doh_escapes | 19 | 16 | 17 | 20 |
20261128T1800Z | 2026-11-28T18:05:27Z | doh_escapes | 19.5 | 16 | 16 | 18.5 |
20261129T0600Z | 2026-11-29T06:05:28Z | doh_escapes | 20 | 16 | 17.5 | 20 |
20261129T1800Z | 2026-11-29T18:05:17Z | doh_escapes | 21 | 16 | 20 | 22.5 |
20261130T0600Z | 2026-11-30T06:05:22Z | doh_escapes | 23 | 18.5 | 18 | 20 |
20261130T1800Z | 2026-11-30T18:05:14Z | doh_escapes | 21 | 17 | 18 | 20.5 |
20261201T0600Z | 2026-12-01T06:05:09Z | doh_escapes | 19 | 17 | 19 | 21.5 |
Per-slot median milliseconds across the 12 names.
Name-level patterns
Two names stood out on latency. example.com is first in the fixed order and had a Cloudflare DoH median of 35 ms (Google 24 ms) against 17 to 20 ms for most other names, consistent with first-query connection warm-up in each slot. Because we did not randomize order, we cannot separate position from name. freepolicytools.com is last and was the slowest name on every condition that touches the real network (baseline 36 ms, Cloudflare 29 ms, Google 33 ms) while its hijacked lookup stayed at 16 ms, so the extra time sits in the real lookup path for that name and not in DoH.
What it means
Escape is a property of how the resolver is found
DoH escapes a DNS-layer hijack when the client reaches its resolver without plaintext DNS, and it does not when the client needs plaintext DNS to find the resolver. That is a mechanism, not a surprise. The value of the study is the bound around it: 360 of 360 escapes, 0 of 360 contaminated answers, no time-of-day effect and a median cost indistinguishable from the baseline.
Captive-detection probes and the DNS signal
The four captive-probe names all resolved to real addresses over DoH while the hijacker returned the decoy for them. Clients detect portals by fetching probe URLs and checking the response. A lookup that escapes the portal’s DNS removes one of the two signals a network can use to redirect that fetch. The other signal is interception of the HTTP connection, which we did not measure. This is one reason the portal ecosystem is moving toward explicit signaling through RFC 8910 rather than treating DNS poisoning as the primary mechanism.
Hostname-configured DoH is the fragile case
A client configured with a DoH hostname must resolve it before opening the HTTPS connection. Our hijacker returned the decoy for both hostnames in 30 of 30 attempts, so a client in that position receives an unreachable documentation address. Whether it falls back to system DNS, retries a built-in bootstrap address or fails closed is a client decision we did not measure.
For people on public Wi-Fi
If you rely on DoH for privacy on hotel or airport Wi-Fi, an IP-addressed DoH resolver is a way around DNS-level portal tricks. The corollary is that you may also bypass a portal that works only through DNS, and you may need to switch encrypted DNS off briefly to see the sign-in page. For protecting traffic once you are through the gate, see our best VPN for travel guide, the DNS leaks prevention guide, and the comparison of Smart DNS vs VPN.
For people who build or operate networks
DNS poisoning is a blunt instrument against clients that address a resolver by IP. A portal that needs DoH clients to see it has to use the standard signaling in RFC 8910 or control the egress path another way, which is a firewall question and not a DNS question. We did not test any firewall behavior. For the other leak surfaces in a proxy setup, see our browser path leak research.
Limits
- It is a simulation. We hijacked a resolver we chose to query. No real portal, firewall or walled garden was involved and no VM networking was altered. A real portal usually also redirects HTTP and may block or reset traffic to arbitrary destinations before sign-in. Our result says nothing about whether TCP 443 to 1.1.1.1 or 8.8.8.8 is reachable on any real network.
- The result is structurally expected. A client that connects to an IP literal never asks the hijacker anything, so a 100 percent escape rate follows from the design. The hostname poisoning result is also true by construction because the hijacker answers every A query with the decoy. It checks that the simulation behaved as intended and is not a discovery.
- No browser or operating-system behavior was tested. Not Chrome, Firefox, Safari or Windows DoH fallback logic, canary-domain handling, or captive-portal detection flows.
- JSON DoH, not wire-format DoH. We used
application/dns-jsonfor both resolvers. RFC 8484 wire format over HTTP/2 or HTTP/3 was not tested, nor DNS over TLS or QUIC. - A records only. No AAAA, HTTPS/SVCB or TXT lookups, and no IPv6 paths.
- One vantage. One USA datacenter VM, one resolver configuration, one week.
- Latency comparisons are approximate. The
digtimings include process launch and each DoH timing includes a fresh TLS handshake from a client that does not reuse connections. - Name order was fixed, so the first-name effect cannot be separated from the name.
- Answer-set disagreement was not diagnosed. We localized it to three names and did not test why.
- The proxy contrast is one observation.
- Coverage. 15 of 15 planned slots were collected with no gaps, but the span is 160.8 hours, not 168.
Evidence and reproduction
Everything is in the repository under research/doh-captive-portal-week/. The collector runs the hijacker on a loopback port, so it needs no elevated privileges.
python3 scripts/collect_slot.py --freeze-only
python3 scripts/collect_slot.py --slot 20261124-immediate
python3 scripts/analyze.pyDownloads
Per-slot redacted results live in folders named by slot, for example /research/doh-captive-portal-week/20261124-immediate/results.json. Raw egress addresses, hash salts and proxy credentials are never published.
FAQ
Sources
Affiliate disclosure: this article contains a ProxySeller affiliate link. ProxySeller carried the single Day 0 proxy-contrast probe described above, so it is relevant to the measurements. FreePolicyTools may earn a commission if you purchase through it. The commission does not change our methods, results or limits.