mirror of
https://github.com/2dust/v2rayN.git
synced 2026-08-11 09:42:05 +03:00
e01717d8326a4f5060b335523590c5fda943fe03
The rule added in #9897 takes the TUN inbound's `address` verbatim as `ip_cidr`,
so a /30 or /126 interface prefix becomes the match range.
sing-tun derives the TUN's DNS entry from the address right after the interface's
own and hands it to the system resolver: Windows through luid.SetDNS in
tun_windows.go, Linux through systemd-resolved in tun_linux.go, both guarded only
by AutoRoute && !EXP_DisableDNSHijack. HasNextAddress keeps that address inside
the interface prefix, every preset in Global.TunIPv4Address is a /30 and every
IPv6 preset a /126, and the sing-box system stack rejects single-address
prefixes, so there is no configuration where it falls outside.
Queries from the system resolver then hit the drop rule and time out with no
response and no ICMP. Name resolution fails for the whole system while the proxy
path itself stays healthy, which makes it read as a DNS outage rather than a
routing rule. Reported in #9934 and #9926.
Matching each address on its own keeps what #9897 set out to block - the loop it
diagnosed was addressed to the interface address itself - and leaves the DNS
entry to sing-box.
Also restores the two regression tests #9897 came with, removed by eff58459
(#9817) while its implementation and template fix stayed in place.
ShouldRejectTrafficToTunOwnAddresses now asserts the single-address form and
additionally pins the prefix length, so it covers both the loop it was written
for and the resolver address it must not cover.
Verified on Linux by running sing-box directly from a generated config, changing
only this rule's prefix length between runs:
ip_cidr ["172.18.0.1/30"] getent hosts www.google.com -> empty, 3/3
ip_cidr ["172.18.0.1/32"] getent hosts www.google.com -> resolved, 3/3
dig against a public resolver, naked-IP HTTPS and the local mixed port were
unaffected in both runs. End to end, a build of this branch emits
drop ip_cidr ["172.18.0.1/32"] and system resolution works while its TUN is up.
Co-authored-by: liuclare <177657698+liuclare@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
v2rayN
A GUI client for Windows, Linux and macOS. Support Xray and sing-box and others
Download / 下载
Download the latest release here:
在这里下载最新版本:
https://github.com/2dust/v2rayN/releases
Tip
v2rayN is the desktop version. For the mobile version, please visit the v2rayNG
v2rayN 是电脑版,手机版请访问 v2rayNG
Documentation / 使用文档
Read the Wiki for usage guides and configuration details.
请阅读 Wiki 获取使用说明和配置教程。
https://github.com/2dust/v2rayN/wiki
Supported Platforms / 支持平台
| Platform / 平台 | x64 | x86 | arm64 | riscv64 | loong64 |
|---|---|---|---|---|---|
| Windows | ✅ | ✅ | ✅ | - | - |
| Linux | ✅ | - | ✅ | ✅ | ✅ |
| macOS | ✅ | - | ✅ | - | - |
Minimum OS requirements: Release files introduction / 最低系统要求:发布文件介绍
GPG Verification / GPG 签名校验
Release files are signed with GPG to verify authenticity and integrity, helping prevent mirror, ISP, or CDN hijacking.
发布文件已使用 GPG 签名,可用于校验文件真实性与完整性,预防镜像站、运营商或 CDN 劫持。
Fingerprint / 公钥指纹
7694 5E9F 3E9A 168F 8070 F195 805D 661C
134D FAF6 8903 C199 463C 31E5 AE90 3AE0
Community / 社区
Telegram Group / Telegram 群组:
Telegram Channel / Telegram 频道:
Languages
C#
92%
Shell
8%