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

Open
opened 2026-10-14 03:43:36 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @ArconWell on GitHub (Sep 22, 2026).
Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/3198

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.

Originally created by @ArconWell on GitHub (Sep 22, 2026). Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/3198 ### 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](https://github.com/user-attachments/files/32527166/AmneziaVPN.log) [AmneziaVPN-service.log](https://github.com/user-attachments/files/32527167/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.
Author
Owner

@qpEHuKC82 commented on GitHub (Sep 28, 2026):

I can reproduce what looks like the same issue on Windows.

Environment:

  • Windows: windows 10 22H2 version 22H2 build 19045.7725
  • AmneziaVPN: 5.0.3.0
  • Self-hosted XRay VLESS + Reality
  • Transport: RAW TCP
  • Flow: xtls-rprx-vision
  • Server port: [redacted]
    tun2:
  • Interface: tun2socks Tunnel
  • IPv4: 10.33.0.2
  • MTU: 65535 by default
  • DNS test to 172.29.172.254: timeout

Symptoms:

  • The UI shows Connected.
  • tun2 is created and tun2socks.exe is running.
  • tun2 receives IPv4 10.33.0.2.
  • Full-tunnel routes are added through tun2.
  • The private DNS address 172.29.172.254 is routed via tun2 but does not answer:
    nslookup example.com 172.29.172.254
    -> request timed out
  • curl.exe -I https://example.com
    -> Resolving timed out
  • Direct TCP connectivity from Windows to the XRay server port works.
  • The same self-hosted XRay server/profile works on iPhone via AmneziaVPN.

Diagnostics already performed:

  • VPS XRay Docker container is Up and listens on its TCP port.
  • The VPS has outbound Internet access.
  • Rebooting/resetting Windows network stack did not help:
    netsh winsock reset
    netsh int ip reset
    ipconfig /flushdns
  • Removing Kaspersky and Cisco AnyConnect remnants did not help.
  • Temporarily changing tun2 MTU from 65535 to 1400 did not help.

Please let me know which client logs or additional diagnostics would be useful.

<!-- gh-comment-id:5871969073 --> @qpEHuKC82 commented on GitHub (Sep 28, 2026): I can reproduce what looks like the same issue on Windows. Environment: - Windows: windows 10 22H2 version 22H2 build 19045.7725 - AmneziaVPN: 5.0.3.0 - Self-hosted XRay VLESS + Reality - Transport: RAW TCP - Flow: xtls-rprx-vision - Server port: [redacted] tun2: - Interface: tun2socks Tunnel - IPv4: 10.33.0.2 - MTU: 65535 by default - DNS test to 172.29.172.254: timeout Symptoms: - The UI shows Connected. - tun2 is created and tun2socks.exe is running. - tun2 receives IPv4 10.33.0.2. - Full-tunnel routes are added through tun2. - The private DNS address 172.29.172.254 is routed via tun2 but does not answer: nslookup example.com 172.29.172.254 -> request timed out - curl.exe -I https://example.com -> Resolving timed out - Direct TCP connectivity from Windows to the XRay server port works. - The same self-hosted XRay server/profile works on iPhone via AmneziaVPN. Diagnostics already performed: - VPS XRay Docker container is Up and listens on its TCP port. - The VPS has outbound Internet access. - Rebooting/resetting Windows network stack did not help: netsh winsock reset netsh int ip reset ipconfig /flushdns - Removing Kaspersky and Cisco AnyConnect remnants did not help. - Temporarily changing tun2 MTU from 65535 to 1400 did not help. Please let me know which client logs or additional diagnostics would be useful.
Author
Owner

@artxxx001 commented on GitHub (Nov 3, 2026):

I can confirm a very similar shared-config DNS failure on Linux, specifically Pop!_OS 24.04 LTS (COSMIC), AmneziaVPN 5.0.3.0 (de93650), Xray.

The VPN connection was originally created on a phone and then imported to the Linux laptop using Share connection. It displayed Connected, and HTTPS through the tunnel worked when bypassing DNS (curl --resolve returned HTTP/2 200), but ordinary DNS requests timed out and websites would not load.

Diagnostics:

  • resolvectl status tun2 showed 172.29.172.254 as the resolver despite setting 1.1.1.1 and 1.0.0.1 in the client.
  • resolvectl query -4 example.com timed out.
  • Local Xray repeatedly logged accepted udp:172.29.172.254:53 (and also TCP/53), with no DNS response observed.
  • The Amnezia firewall's amnvpn.320.allowDNS ACCEPT counters increased on tun2 during lookups (UDP/53: 14 -> 34 packets; TCP/53: 0 -> 32), while amnvpn.310.blockDNS and amnvpn.100.blockAll counters remained at 0. That shows DNS requests were allowed by those local rules, not where the replies were lost.
  • With VPN disconnected, resolvectl query example.com succeeded in ~31 ms.

Confirmed fix: On the phone, I disabled AmneziaDNS, generated a new sharing link, and imported that new configuration into Linux. This immediately fixed the DNS issue. The new resolvectl status tun2 showed:

Current DNS Server: 1.0.0.1
DNS Servers: 1.1.1.1 1.0.0.1
DNS Domain: ~.

resolvectl query -4 example.com succeeded in ~290 ms, and a normal curl -4 -I --noproxy '*' https://example.com returned HTTP/2 200.

This suggests that the issue with DNS information embedded in a shared Xray configuration / client DNS handling also affects Linux, not only Windows. The exact point where traffic to the private DNS destination is lost was not conclusively proven in my Linux test.

<!-- gh-comment-id:6604865994 --> @artxxx001 commented on GitHub (Nov 3, 2026): I can confirm a very similar **shared-config DNS failure on Linux**, specifically **Pop!_OS 24.04 LTS (COSMIC), AmneziaVPN 5.0.3.0 (`de93650`), Xray**. The VPN connection was originally created on a phone and then imported to the Linux laptop using **Share connection**. It displayed **Connected**, and HTTPS through the tunnel worked when bypassing DNS (`curl --resolve` returned `HTTP/2 200`), but ordinary DNS requests timed out and websites would not load. Diagnostics: - `resolvectl status tun2` showed `172.29.172.254` as the resolver despite setting `1.1.1.1` and `1.0.0.1` in the client. - `resolvectl query -4 example.com` timed out. - Local Xray repeatedly logged `accepted udp:172.29.172.254:53` (and also TCP/53), with no DNS response observed. - The Amnezia firewall's `amnvpn.320.allowDNS` ACCEPT counters increased on `tun2` during lookups (UDP/53: 14 -> 34 packets; TCP/53: 0 -> 32), while `amnvpn.310.blockDNS` and `amnvpn.100.blockAll` counters remained at 0. That shows DNS requests were allowed by those local rules, not where the replies were lost. - With VPN disconnected, `resolvectl query example.com` succeeded in ~31 ms. **Confirmed fix:** On the phone, I **disabled AmneziaDNS, generated a new sharing link, and imported that new configuration into Linux**. This immediately fixed the DNS issue. The new `resolvectl status tun2` showed: ```text Current DNS Server: 1.0.0.1 DNS Servers: 1.1.1.1 1.0.0.1 DNS Domain: ~. ``` `resolvectl query -4 example.com` succeeded in ~290 ms, and a normal `curl -4 -I --noproxy '*' https://example.com` returned `HTTP/2 200`. This suggests that the issue with DNS information embedded in a shared Xray configuration / client DNS handling also affects **Linux**, not only Windows. The exact point where traffic to the private DNS destination is lost was **not conclusively proven** in my Linux test.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amnezia-client#1482
No description provided.