#6454·Xray-core

tun模式存在dns泄漏

Author: PhoenixNilCreated Jul 8, 2026Updated Sep 11, 2026
LabelsPR welcome

完整性要求

  • 我读完了 issue 模板中的所有注释,确保填写符合要求。
  • 我保证阅读了文档,了解所有我编写的配置文件项的含义,而不是大量堆砌看似有用的选项或默认值。
  • 我提供了完整的配置文件和日志,而不是出于自己的判断只给出截取的部分。
  • 我搜索了 issues, 没有发现已提出的类似问题。
  • 问题在 Release 最新的版本上可以成功复现

描述

开启tun模式会出现dns泄漏的问题

重现方式

把v2rayN的config.json 文件复制到xray目录下面 用 .\\xray.exe -c config.json 然后访问各种检测dns泄漏网站会出现dns泄漏的问题

客户端配置

{ "log": { "loglevel": "debug", "dnsLog": true }, "dns": { "servers": [ { "address": "223.5.5.5", "domains": [ "geosite:cn", "geosite:private" ], "skipFallback": true }, { "address": "8.8.8.8" } ], "queryStrategy": "UseIPv4", "disableCache": false }, "inbounds": [ { "tag": "tun-in", "protocol": "tun", "settings": { "name": "xray0", "mtu": 1500, "gateway": [ "10.0.0.1/16", "fc00::1/64" ], "dns": [ "1.1.1.1", "8.8.8.8" ], "userLevel": 0, "autoSystemRoutingTable": [ "0.0.0.0/0", "::/0" ], "autoOutboundsInterface": "auto" }, "sniffing": { "enabled": true, "destOverride": [ "http", "tls", "quic" ] } }, { "tag": "mixed-in", "protocol": "socks", "listen": "127.0.0.1", "port": 16890, "settings": { "auth": "noauth", "udp": true } } ], "outbounds": [ { "tag": "proxy", "protocol": "shadowsocks", "settings": { "servers": [ { "address": "", "port": , "method": "2022-blake3-aes-128-gcm", "password": "" } ] }, "streamSettings": { "network": "tcp" } }, { "tag": "direct", "protocol": "freedom", "settings": {} }, { "tag": "block", "protocol": "blackhole", "settings": {} }, { "tag": "dns-out", "protocol": "dns" } ], "routing": { "domainStrategy": "AsIs", "rules": [ { "type": "field", "inboundTag": [ "tun-in" ], "port": "53", "outboundTag": "dns-out" }, { "type": "field", "outboundTag": "direct", "process": [ "self/", "xray/" ] }, { "type": "field", "outboundTag": "block", "network": "udp", "port": "443" }, { "type": "field", "outboundTag": "proxy", "domain": [ "geosite:google" ] }, { "type": "field", "outboundTag": "direct", "domain": [ "geosite:cn", "geosite:private" ] }, { "type": "field", "outboundTag": "direct", "ip": [ "geoip:cn", "geoip:private" ] }, { "type": "field", "outboundTag": "proxy", "network": "tcp,udp" } ] } }

服务端配置

由于是机场无法提供

客户端日志

新建 文本文档.txt 太大超过65536个字符

服务端日志

机场节点无法提供