Relayed connection to exit node with aliases enabled sends DNS while tunnel isn't ready yet
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 领域
- mobile, networking
调研方向
Start by tracing how the Android client sets up DNS override and tunnel DNS while connecting through a relay; the issue does not name source files or tests. Use the provided reproduction steps with aliases enabled and force relay mode by blocking the handshake response. Done means the client connects through the relay and resolves the Pangolin domain without sending DNS through the tunnel before it is ready.
由索引模型根据 Issue 内容生成。
描述
Describe the Bug
When you attempt to connect to your Pangolin server while on a more restricted network, the direct WireGuard connection to the exit node might fail and requires you to use relay mode.
However, it seems to get stuck for me on the "registering" step. Looking closer at the logs it seems like the Pangolin client is trying to resolve the Pangolin domain through the tunnel, which isn't ready yet, causing the request to timeout and it never connects.
My phone is able to connect if I'm connected via mobile data, as then it manages to get a direct connection to the exit node. Strangely enough if I attempt to connect to the same exit node using the same DNS settings on my Macbook, which is on the same restricted network, it can connect via relay mode, indicating the server configuration is correct.
I also double checked if it wasn't an IPv4 vs IPv6 issue, but the restricted network I tested on doesn't have a public IPv6 address, so both my phone and Macbook connected via IPv4.
Entire log file: pangolin_cleaned.log
This log file is generated while my phone was connected to mobile data, with the Newt exit node having the iptables reproduce method enabled.
Some parts of this log have been replaced with the following dummy values:
- Organization ID:
example - Pangolin domain:
pangolin.example.net - Pangolin server IP:
111.111.111.111 - Exit node server IP:
222.222.222.222
Relevant logs snippet:
2026-11-18 19:37:15.124 [WARN] PangolinGo: olm: giving up on olm/wg/relay for site 3 (chain ed2dad0583be6711) after 10 attempts
2026-11-18 19:37:15.125 [DEBUG] PangolinGo: websocket: Sending message: olm/wg/relay, data: map[chainIds:[aeb106ebcf51aab6] siteIds:[3]]
2026-11-18 19:37:15.127 [INFO] PangolinGo: olm: sent batched olm/wg/relay for 1 site(s)
2026-11-18 19:37:17.125 [DEBUG] PangolinGo: websocket: Sending message: olm/wg/relay, data: map[chainIds:[aeb106ebcf51aab6] siteIds:[3]]
2026-11-18 19:37:17.126 [INFO] PangolinGo: olm: sent batched olm/wg/relay for 1 site(s)
2026-11-18 19:37:17.456 [DEBUG] PangolinGo: DNS query for pangolin.example.net. (type AAAA)
2026-11-18 19:37:17.457 [DEBUG] PangolinGo: No local record for pangolin.example.net., forwarding upstream to [10.70.0.20:53 10.70.0.20:53]
2026-11-18 19:37:17.457 [DEBUG] PangolinGo: DNS query for pangolin.example.net. (type A)
2026-11-18 19:37:17.457 [DEBUG] PangolinGo: wireguard: peer(o+Dd…Zgj0) - Sending handshake initiation
2026-11-18 19:37:17.457 [DEBUG] PangolinGo: No local record for pangolin.example.net., forwarding upstream to [10.70.0.20:53 10.70.0.20:53]
2026-11-18 19:37:19.124 [DEBUG] PangolinGo: websocket: Sending message: olm/wg/relay, data: map[chainIds:[aeb106ebcf51aab6] siteIds:[3]]
2026-11-18 19:37:19.125 [INFO] PangolinGo: olm: sent batched olm/wg/relay for 1 site(s)
2026-11-18 19:37:19.458 [DEBUG] PangolinGo: Primary DNS failed, trying secondary: failed to read response: read udp 100.90.128.3:30778: i/o timeout
2026-11-18 19:37:19.458 [DEBUG] PangolinGo: Primary DNS failed, trying secondary: failed to read response: read udp 100.90.128.3:33252: i/o timeout
2026-11-18 19:37:21.124 [DEBUG] PangolinGo: websocket: Sending message: olm/wg/relay, data: map[chainIds:[aeb106ebcf51aab6] siteIds:[3]]
2026-11-18 19:37:21.125 [INFO] PangolinGo: olm: sent batched olm/wg/relay for 1 site(s)
2026-11-18 19:37:21.460 [ERROR] PangolinGo: Both DNS servers failed: failed to read response: read udp 100.90.128.3:39103: i/o timeout
2026-11-18 19:37:21.461 [ERROR] PangolinGo: Failed to get DNS response for pangolin.example.net.
2026-11-18 19:37:21.461 [ERROR] PangolinGo: Both DNS servers failed: failed to read response: read udp 100.90.128.3:64134: i/o timeout
2026-11-18 19:37:21.461 [ERROR] PangolinGo: Failed to get DNS response for pangolin.example.net.
2026-11-18 19:37:22.461 [DEBUG] PangolinGo: DNS query for pangolin.example.net. (type AAAA)
2026-11-18 19:37:22.462 [DEBUG] PangolinGo: No local record for pangolin.example.net., forwarding upstream to [10.70.0.20:53 10.70.0.20:53]
2026-11-18 19:37:22.462 [DEBUG] PangolinGo: DNS query for pangolin.example.net. (type A)
2026-11-18 19:37:22.462 [DEBUG] PangolinGo: No local record for pangolin.example.net., forwarding upstream to [10.70.0.20:53 10.70.0.20:53]
2026-11-18 19:37:22.462 [DEBUG] PangolinGo: wireguard: peer(o+Dd…Zgj0) - Sending handshake initiation
2026-11-18 19:37:23.124 [DEBUG] PangolinGo: websocket: Sending message: olm/wg/relay, data: map[chainIds:[aeb106ebcf51aab6] siteIds:[3]]
2026-11-18 19:37:23.125 [INFO] PangolinGo: olm: sent batched olm/wg/relay for 1 site(s)
2026-11-18 19:37:24.464 [DEBUG] PangolinGo: Primary DNS failed, trying secondary: failed to read response: read udp 100.90.128.3:42782: i/o timeout
2026-11-18 19:37:24.464 [DEBUG] PangolinGo: Primary DNS failed, trying secondary: failed to read response: read udp 100.90.128.3:56227: i/o timeout
2026-11-18 19:37:25.126 [DEBUG] PangolinGo: websocket: Sending message: olm/wg/relay, data: map[chainIds:[aeb106ebcf51aab6] siteIds:[3]]
2026-11-18 19:37:25.127 [INFO] PangolinGo: olm: sent batched olm/wg/relay for 1 site(s)
2026-11-18 19:37:26.465 [ERROR] PangolinGo: Both DNS servers failed: failed to read response: read udp 100.90.128.3:54710: i/o timeout
2026-11-18 19:37:26.466 [ERROR] PangolinGo: Failed to get DNS response for pangolin.example.net.
2026-11-18 19:37:26.466 [ERROR] PangolinGo: Both DNS servers failed: failed to read response: read udp 100.90.128.3:35217: i/o timeout
2026-11-18 19:37:26.466 [ERROR] PangolinGo: Failed to get DNS response for pangolin.example.net.
2026-11-18 19:37:27.124 [DEBUG] PangolinGo: websocket: Sending message: olm/wg/relay, data: map[chainIds:[aeb106ebcf51aab6] siteIds:[3]]
2026-11-18 19:37:27.125 [INFO] PangolinGo: olm: sent batched olm/wg/relay for 1 site(s)
2026-11-18 19:37:27.468 [ERROR] PangolinGo: Failed to resolve primary relay endpoint for site 3: DNS lookup failed using all upstream servers: lookup pangolin.example.net on [::1]:53: read udp 100.90.128.3:34256->84.241.227.81:53: i/o timeout
2026-11-18 19:37:27.469 [DEBUG] PangolinGo: websocket: setting config version to 0
2026-11-18 19:37:27.469 [DEBUG] PangolinGo: Received relay-peer message: map[chainIds:[ee733d283687444e] relayEndpoints:[pangolin.example.net] relayPort:21820 siteIds:[3]]
2026-11-18 19:37:27.469 [WARN] PangolinGo: CancelRelaySend: no active sender for chain ee733d283687444e
2026-11-18 19:37:27.470 [DEBUG] PangolinGo: wireguard: peer(o+Dd…Zgj0) - Sending handshake initiation
2026-11-18 19:37:29.125 [DEBUG] PangolinGo: websocket: Sending message: olm/wg/relay, data: map[chainIds:[aeb106ebcf51aab6] siteIds:[3]]
2026-11-18 19:37:29.127 [INFO] PangolinGo: olm: sent batched olm/wg/relay for 1 site(s)
2026-11-18 19:37:29.513 [INFO] PangolinGo: Holepunch to site 3 failed 10 times, triggering relay
2026-11-18 19:37:29.514 [INFO] PangolinGo: Queued relay message for site 3 (chain cbc97e63a19bcca5)
2026-11-18 19:37:29.715 [WARN] PangolinGo: olm: giving up on olm/wg/relay for site 3 (chain aeb106ebcf51aab6) after 10 attempts
Environment
- OS Type & Version: LineageOS 23.2 (Android 16) on a Google Pixel 6
- Pangolin Version: 1.25.3
- Edition (Community or Enterprise): Enterprise (Personal)
- Gerbil Version: 1.5.2
- Traefik Version: 3.7
- Newt Version: 1.19 via Docker
- Client Version: Android 0.8.3 from Play Store, compared against macOS 0.12.2 installed via Brew
To Reproduce
Please note that we will need to force the relay path for this issue, it doesn't seem to happen with direct connections to the site that is used as an exit node.
- Set up a site (Newt running via Docker in my case) with an exit node, and give the user access.
- On the Android client, set an upstream DNS server (PiHole server accessible from LAN in my case), enable "Enable Aliases (DNS override)" and "DNS over tunnel", and select the exit node.
- Put the phone on mobile data and note its public IP.
- On the Newt host that will act as the exit node, temporarily block the handshake response from reaching the phone in order to force relay mode:
sudo iptables -I DOCKER-USER -p udp -d <phone public IP> -j DROP
- Attempt to connect with the Android client.
- Observed: the client gets stuck at "Registering". The client log shows the relay-peer message, followed by the failed relay endpoint lookup from the tunnel IP. The Newt log repeatedly shows "Removing Endpoint for peer ..." (relay mode), but no traffic from the client arrives
- Disable "Enable Aliases (DNS override)" option
- Attempt to connect again: the client connects after a relatively long wait (about 20 seconds until the DNS timeout)
If it helps, here is a blueprint you can use:
- "pangolin.private-resources.example-site-exit-node.enabled=true"
- "pangolin.private-resources.example-site-exit-node.name=Example site Exit Node"
- "pangolin.private-resources.example-site-exit-node.mode=exit-node"
- "pangolin.private-resources.example-site-exit-node.sites[0]=example-site"
- "pangolin.private-resources.example-site-exit-node.roles[0]=Home Exit Node"
# This didn't make a difference for me, but the app did specifically mention you should add the DNS server as a resource
- "pangolin.private-resources.example-site-pihole.enabled=true"
- "pangolin.private-resources.example-site-pihole.name=Example site PiHole"
- "pangolin.private-resources.example-site-pihole.mode=host"
- "pangolin.private-resources.example-site-pihole.destination=10.70.0.20" # This should point to the IP of the DNS server on the LAN that the exit node can access
- "pangolin.private-resources.example-site-pihole.tcp-ports=53-53" # Also potentially another bug? Pangolin refuses the blueprint if just `53` was entered, so we use a range instead and then it does accept it
- "pangolin.private-resources.example-site-pihole.udp-ports=53-53"
- "pangolin.private-resources.example-site-pihole.disable-icmp=false"
- "pangolin.private-resources.example-site-pihole.sites[0]=example-site"
- "pangolin.private-resources.example-site-pihole.roles[0]=Home Exit Node"
And the following settings have been used inside the Pangolin client:
AI Disclosure
Claude was used to help troubleshoot the issue and process the log files.
It has also been used to come up with a more easily reproducible setup, which I was able to verify by triggering this issue from a network I know was able to connect to my Pangolin instance.
This issue report was written completely by hand and validated manually.
If the issue is difficult to reproduce for you guys, I'm able to verify if a potential fix also actually fixes it in my case.
Expected Behavior
When enabling the connection inside the Pangolin app with an exit node active and custom DNS server configured in the settings, it can connect to the exit node and also perform queries to the custom DNS server, even when the connection is in relay mode.
- 主要语言
- Kotlin
- 星标
- 46
- 派生
- 15
- 平均合并
- 1 分钟
- 30 天内合并 PR
- 3
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
fosrl/android 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 72/100
-
bug needs investigating
难度 4/5 3-5 天 新手友好度 45/100
-
Possible client registration regression on version 0.7.0可能已有人在做 @oschwartz10612 于 26 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 45/100
-
难度 4/5 3-5 天 新手友好度 48/100
-
Switching organizations breaks Olm hole punching for the same client installation可能重新可做 @oschwartz10612 于 58 天前认领,目前没有进行中的 PR。 未关闭needs investigating
难度 4/5 3-5 天 新手友好度 48/100
相似的 Issue
-
bug desktop
难度 2/5 1-3 小时 新手友好度 85/100
simplex-chat/simplex-chat#8291 ·
维护者通常 1 天内回复
-
help wanted needs investigation priority: low
难度 2/5 1-3 小时 新手友好度 62/100
-
bug
难度 2/5 1-3 小时 新手友好度 62/100
LeanBitLab/LeanType#883 ·
维护者通常 1 天内回复
-
Heavy legs 1.12–1.17: compiler corpus goldens not regenerated for #4770可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
intellij-elixir/intellij-elixir#4782 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
komikku-app/komikku#1983 ·
维护者通常 1 天内回复