Repository navigation
FakeDNS: Change default FakeIPv6Pool to 2001:2::/48 - #6815
Conversation
Change default FakeDNS IPv6 pool to avoid Chrome's Private Network Access (PNA) prompts
|
确实该改 就是不知道会不会有什么防火墙问题啥的 |
|
我这这样配置用了很久了目前还没遇到防火墙问题 |
|
如果 Xray 关了,应用会不会把流量直接发到公网而造成某种泄露?尤其是 TUN、没路由器的时候 |
|
To be honest, |
|
这个 PR 会被合并,但我只是脑洞到上述问题,没人报告过泄露不等于没泄露过,尤其是纯 Xray 的话 FakeDNS 主要是用在外部路由器 TPROXY 上,而加上 TUN 之后本机直接拨号/蜂窝网络也能用,ISP 想的话只要声称能通这些网段,应用的第一个握手包就会被路由过去,如果有路由器的话可能能覆盖/有层防护, |
|
现在 FakeDNS 返回的查询结果 TTL 是 1,除了刚断开的一小段时间以及应用不遵守 TTL 的情况其余的时间倒是还好 |
|
|
|
|
|
|
|
于是我又想到另一个问题,如果没给网卡配置境外 DoH 的话那么应用的下个 DNS 查询也是直接泄露,但应该没人给网卡配置境外 DoH 吧不然不设 source 的话国内的应用会变得奇奇怪怪,反之亦然,另外这还和 TUN 要解决的 DNS 泄露问题 互相冲突
|
|
|
PattN dropped the FakeIP range setting (6ee9a88, 97db1d7) because it could only name an IPv4 range, and left the pools to Xray-core's defaults. Upstream's 2dust#10464 adds an optional IPv6 pool, so PattN takes upstream's settings back: the IPv4 range, the IPv6 FakeIP switch and its range in both DNS settings windows, and Xray's "fakedns" block (one pool, or both) and sing-box's fakeip ranges made from them. The defaults keep what PattN gave before: - IPv6 FakeIP is on, also for settings saved without the switch: ConfigHandler sets it on, and both cores and the window read an unset switch as on, so a WebAPI client that leaves it out gets the same; - the IPv6 range defaults to 2001:2::/48, Xray-core's own pool since XTLS/Xray-core#6815; fc00::/18 stays in the list. sing-box still leaves the IPv6 range out of a TUN without IPv6, where fake IPv6 addresses would be unreachable. The WebAPI offers both range lists among the DNS editor options, and refuses an IPv6 range no core could use while the pool is on, as the settings window does.

Change default FakeDNS IPv6 pool to avoid Chrome's Private Network Access (PNA) prompts
This PR addresses the issue raised in #5458
Background
Chromium-based browsers (Chrome v141+) have fully enforced Private Network Access (PNA) protections. When a public website attempts to connect to an IP address classified as "Private," the browser now triggers a "Local network access" permission prompt to the user.
The Problem
Xray-core's default FakeDNS IPv6 pool is
fc00::/18, a subrange offc00::/7(Unique Local Address / ULA space). Because ULA addresses are explicitly classified as Private under the PNA spec, virtually every proxied connection using FakeDNS now triggers this permission popup, the browser interprets ordinary proxied traffic as a public site probing the user's local network.This significantly degrades the browsing experience for anyone using Xray with FakeDNS enabled on Chrome-based browsers, and will only get worse as PNA enforcement expands to cover more request types.
Proposal
Change the default FakeDNS IPv6 range from
fc00::/18to2001:2::/48, reserved by RFC 5180 for benchmarking/testing purposes.Why this range:
2001:2::/48falls under Global Unicast address space, not ULA, so it is never classified as "Private" by the PNA algorithm. Connections to fake IPs in this range no longer trigger the local-network permission prompt.FakeIPv6Poolare unaffected. Existing deployments that rely on the old default can pin it explicitly in their config if needed.Discussion
See #5458 for the original report and community discussion of this issue, including the alternative
2001:db8::/32(RFC 3849, Documentation range) suggestion.2001:2::/48was chosen deliberately over the Documentation range for a semantic reason:2001:db8::/32is explicitly reserved for documentation and examples (RFC 3849), meaning it is intended to never appear in real traffic in some tools, linters, and security scanners specifically flag or special-case addresses in this block as "placeholder/example" values, which could cause confusing behavior if they ever leak into logs, DNS records, or diagnostics.2001:2::/48, by contrast, is the IPv6 Benchmarking range (RFC 5180) which conceptually analogous to198.18.0.0/15in IPv4, which Xray/other proxy tools already use for exactly this kind of fake-IP purpose. Like198.18.0.0/15, this range is:2001:db8::/32, and it's rarely (if ever) used by consumer routers or LAN equipment, minimizing any chance of accidental overlap with a user's actual local network.In short,
2001:2::/48gives the same practical benefits as2001:db8::/32(avoids PNA, non-routable) while mirroring the existing IPv4 convention (198.18.0.0/15) already familiar to this codebase, without inheriting the "documentation address" connotation that could confuse tooling downstream.References