You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In your first point, you're correct that if the Chrome browser (or any browser using the Chrome engine like Edge) initiates a TCP DNS query, it won't be routed by the transparent proxy. Instead, it'll go directly to a domestic DNS server even when the IP is foreign. This causes DNS leakage and it's an issue with how these browsers handle DNS queries.
Your proposed solution to include TCP in the routing rules for port 53 is correct. This will ensure that all DNS traffic, both UDP and TCP, will be handled by Xray or V2ray, preventing DNS leakage.
In your second point, you're also correct that software like v2rayN does not automatically set up an HTTP proxy in Windows 11, leading to DNS queries being sent directly to the system's DNS server. This can also cause DNS leakage.
Your advice to manually set the HTTP and HTTPS settings to V2rayN in the "Internet Options" of Windows is correct. This will ensure that all HTTP and HTTPS traffic is routed through V2rayN's proxy, which will prevent DNS leakage.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
如果有错误请指出。问题分为透明代理劫持DNS,和本地SOCKS代理
基于tcpdump wireshark和ipleak.net测试。
问题1: 简单而言,Chrome内核浏览器(Chrome/Edge)会发起tcp dns查询。这个TCP DNS查询没有被透明代理routing 。直接走了国内DNS查询,即便是国外IP,即便是透明代理有UDP DNS劫持,也会向国内DNS 服务器发起查询,导致DNS泄露。
一般配置SAMPLE 给出的都是
outbounds有如下出口:
"outbounds": [
{
"tag": "dns-out",
"protocol": "dns",
}
路由有如下配置:
"routing": {
"domainStrategy": "AsIs", #其他配置也一样
"rules": [
{
"type": "field",
"inboundTag": [
"all-in" #这个是"dokodemo-door"或者socks
],
"port": 53,
"network": "udp", #这里53 port 只路由了udp包
"outboundTag": "dns-out"
},
.......
如果碰到比如类似这样的配置就会DNS泄露
{
"type": "field",
"ip": [
"geoip:private", #如果本地DNS IP也是局域网路由IP,这一行导致TCP DNS 查询泄露
"geoip:cn"
],
"outboundTag": "direct"
},
另外,本地DNS IP并不一定就是本地路由器IP。 因为上级路由可以配置诸如114.114.114.114的IP下发给我们PC,TCP DNS查询还是可能以114.114.114.114 为dst来查询。所以光去掉这一行,也不保险。到了XRAY CORE里,会走IP路由,发现是国内的,自然走国内出口。一样泄露。
解决:
比较简单,把 routing rules 53端口 network加上 tcp即可。 这样53所有DNS全部给XRAY CORE
"network": "udp,tcp",
以上基于tcpdump 和ipleak.net测试。
简单解释
家用环境下,DHCP CLIENT得到DNS SERVER一般是上级路由DHCP SERVER下发的DNS SERVER IP。 这个IP 可能是路由器自己,也可能是路由器DHCP服务配置的114.114.114.114 等。
chrome发起TCP DNS 所带的目标地址不管是本地路由还是114.。。。,都没有走代理。tproxy下,如果放行本地网段53 port,那么TCP DNS查询就不走代理APP直接被forward 。iptables 不放53, 比如
iptables -w -t mangle -A V2RAY -d $ip_local_address -p tcp ! --dport 53 -j RETURN
那么53port 的TCP来到xray core,走的不是dns路由,而是普通TCP routing。在正常配置中会根据IP地理位置和是否私有而进行routing。 因为TCP 53来的查询,目标IP要么是私有IP,要么是国内DNS IP,所以直接走国内出口。造成DNS泄露。
而windows/mac本机socks5代理情况,是问题2
问题2:
不是xray的问题。 可忽略。只是友情提示,v2rayN等软件,在windows11,没有自动设置http代理,所以DNS还是会走系统DNS查询。导致DNS泄露。
需要进入"internet选项-->连接->局域网设置->高级->http和https设置为 V2RAYN 缺省10809
v2rayN有这个自动功能,在设置->系统代理设置->左下方 高级代理设置,选择第三个,最长的那项
winshark 与 ipleak.net可测
如果不这么设置,chrome输入网址,它直接向系统DNS SERVER发起查询。系统DNS通过中国DNS服务器查到被污染IP。
Beta Was this translation helpful? Give feedback.
All reactions