[Windows][XRay] Client blackholes traffic to private DNS address (AmneziaDNS unreachable), ignores DNS settings from sharing config, leaves stale KillSwitch DNS filters after toggling

Author: ArconWellCreated Sep 22, 2026Updated Sep 28, 2026

Describe the bug

On Windows, the XRay connection shows "Connected" and TCP transport through the tunnel works perfectly, but the client never delivers packets destined to the private AmneziaDNS address (172.29.172.254) into the tunnel — they are accepted by the local xray and blackholed on the laptop (confirmed by packet captures on both ends). Since KillSwitch forbids any other DNS, hostname resolution is impossible: "connected but no websites open". iOS client against the same server uses AmneziaDNS flawlessly.

Two additional independent problems found while diagnosing:

  1. Client DNS settings are ignored in favor of DNS information embedded in the sharing config.
  2. The tunnel adapter's DNS assignment and the KillSwitch/WFP DNS allow-list are driven by different logic, can contradict each other, and stale WFP filters persist until a Windows reboot.

Full layered diagnosis below (following the A/B/C/D framework proposed in #3148). Same user-facing symptom as #1345 (closed unresolved). Unlike the case discussed in #3148, the server-side path here is proven healthy.

To Reproduce

  1. Deploy XRay (XHTTP + REALITY) + AmneziaDNS on a self-hosted server from an iOS client (5.0.2.1 in my case)
  2. Share the connection config to a Windows 11 machine, connect with XRay
  3. Try to open any website → nothing resolves; nslookup wikipedia.org times out through all retries
  4. nslookup -vc (TCP) to 172.29.172.254 hangs as well; apps with hardcoded IPs (Telegram) keep working
  5. curl -v --resolve www.wikipedia.org:443:185.15.59.224 https://www.wikipedia.org/ → 200 OK, full page — TCP transport is healthy, only DNS is dead

Expected behavior

  • DNS queries to the AmneziaDNS address should be routed into the tunnel like any other tunnel-bound traffic (iOS does this correctly against the same server).
  • Client DNS settings should take precedence over (or at least not be silently overridden by) DNS information embedded in a sharing config.
  • The tunnel adapter's DNS assignment and the KillSwitch DNS allow-list should always agree, and all WFP filters should be removed on disconnect.

Log files

Attached: app + service logs from a failing session (secrets redacted: server IP → SERVER_IP, socks5 credentials → REDACTED). Key evidence in them: local xray endlessly repeating accepted udp ... -> 172.29.172.254:53 with no responses; Failed to stop xray and WindowsSplitTunnel: Stopping Split tunnel not successfull on every disconnect.

AmneziaVPN.log AmneziaVPN-service.log

(For the additional problems no logs are attached)

Screenshots

—

Desktop (please complete the following information):

  • OS: Windows 11 25H2 (x86_64)
  • Version: 5.0.3.0 (de93650a9); also reproduced on 5.0.1.5

Smartphone (please complete the following information):

  • Device: iPhone (used as admin device and as comparison client — NOT affected)
  • OS: iOS 26.6.2
  • Version: 5.0.3.0 (works correctly against the same server, same days)

Server (please complete the following information):

  • OS: Debian 11; containers: amnezia-xray (VLESS + XHTTP + REALITY, port 443, deployed by iOS client 5.0.2.1 → client-generated server.json) and amnezia-dns (unbound at 172.29.172.254 on amnezia-dns-net)

Additional context

Layered diagnostics (A/B/C/D framework from #3148):

A/B — server containers healthy:

  • amnezia-xray is attached to amnezia-dns-net (docker network inspect shows amnezia-xray, amnezia-awg2, amnezia-dns)
  • docker exec amnezia-xray nslookup wikipedia.org 172.29.172.254 answers instantly with correct records
  • The client-generated server.json contains a single freedom outbound and no routing section — nothing blocks private ranges server-side

C — passes from iOS, fails from Windows, and the loss is on the Windows client side:

  • Server-side tcpdump -ni any port 53 and host 172.29.172.254 shows the iOS client's queries arriving from the tunnel (source = xray container) and being answered immediately: client → XHTTP → server xray → DNS container → back works with this server deployment.
  • With the Windows client connected, a canary query (nslookup kasha-proverka-12345.com, invented domain) produces zero packets in the same server-side capture, while the laptop's own log shows local xray accepting the queries. So packets to the private DNS address are blackholed inside the Windows client chain before entering the tunnel.

UDP transport through the tunnel is fine — only private destinations die:

  • With client DNS set to 1.1.1.1, the same canary query is visible in server-side tcpdump traversing tunnel → NAT → 1.1.1.1 and back, and nslookup receives the answer.

  • Control experiment: from the same Windows machine, minutes apart, AmneziaWG to the same server resolves via 172.29.172.254 successfully (nslookup answers), while XRay times out. So the blackhole is specific to the Windows XRay chain (tun2socks → local xray), not to the OS, the tunnel adapter concept, or the server.

D — two more independent client-side problems:

  1. DNS settings ignored with the original sharing config: with a config issued while AmneziaDNS was installed, the client kept assigning 172.29.172.254 to the tunnel adapter regardless of "Use AmneziaDNS" = off, custom DNS 1.1.1.1/1.0.0.1, full app restart, reconnects. Only re-issuing the sharing config from the admin device with AmneziaDNS disabled made the client honor the configured DNS.
  2. Adapter DNS vs KillSwitch allow-list disagree; stale WFP filters: with the re-issued config, toggling "Use AmneziaDNS" ON does not assign 172.29.172.254 to the adapter (nslookup still shows 1.1.1.1), but the KillSwitch/WFP DNS rules switch to allowing only 172.29.172.254 — all queries to the actually-assigned 1.1.1.1 start timing out. Toggling back OFF does not recover: stale filters persist until a Windows reboot.

Working workaround for Windows users: re-issue the connection config with AmneziaDNS disabled on the admin device, set client DNS to 1.1.1.1/1.0.0.1. Everything then works, including KillSwitch and split tunneling. AmneziaDNS itself remains unusable from Windows until the private-destination blackhole is fixed. Do not touch the "Use AmneziaDNS" toggle afterwards — it breaks the session as described and requires a reboot.

Source: amnezia-vpn/amnezia-client