-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Freedom 出站请求错误的 DNS 服务器 #4728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
你这种入站方式进来的是域名,一路到出站都是域名没有ip |
感谢提醒,我忘记提及这一点了,但是请不要着急关闭 Issue,还有一个问题没有解决:在没有配置内置 DNS 服务器时,无论是 |
既然没ipv6为啥会有v6的dns 我试过各种发行版默认配置下没遇到过这种现象 |
你系统设置成了这个不就是这个 它是直接调用系统API进行解析的 你curl或者别的任何普通的网络程序大概率都是走的这个DNS 要改也是你从系统改 |
结论:并不是 我判断并不是系统设置错误的原因因为除了 Xray 以外的所有该计算机上的应用程序都能正常 Lookup,包括其他 Go 程序 对不同程序的分析我尝试了一下单独写一个 Go 程序 if _, err := net.LookupIP("www.baidu.com"); err != nil {
fmt.Println("Failed")
} else {
fmt.Println("Success")
} 这份代码打印 Success 而同样的内容在我注入进 Xray 后,打印了 Failed StackTrace当我把 2025/05/15 10:00:53.822801 [Info] [2998206901] app/dispatcher: default route for tcp:www.baidu.com:443
panic: lookup www.baidu.com on [::1]:53: read udp [::1]:50986->[::1]:53: read: connection refused
goroutine 35 [running]:
github.com/xtls/xray-core/features/dns/localdns.(*Client).LookupIP(0x0?, {0xc00038c2f0?, 0x0?}, {0x0?, 0x0?, 0x0?})
github.com/xtls/xray-core/features/dns/localdns/client.go:26 +0x48f
github.com/xtls/xray-core/proxy/freedom.(*Handler).resolveIP(0xc00038f560, {0x163f588, 0xc0002882d0}, {0xc00038c2f0, 0xd}, {0x0, 0x0?})
github.com/xtls/xray-core/proxy/freedom/freedom.go:74 +0x1e6
github.com/xtls/xray-core/proxy/freedom.(*Handler).Process.func1()
github.com/xtls/xray-core/proxy/freedom/freedom.go:136 +0x18d
github.com/xtls/xray-core/common/retry.(*retryer).On(0xc000243cb8, 0xc000243bc0)
github.com/xtls/xray-core/common/retry/retry.go:27 +0xc3
github.com/xtls/xray-core/proxy/freedom.(*Handler).Process(0xc00038f560, {0x163f588, 0xc0002882d0}, 0xc0000b0420, {0x163cad0, 0xc00037d700})
github.com/xtls/xray-core/proxy/freedom/freedom.go:133 +0x447
github.com/xtls/xray-core/app/proxyman/outbound.(*Handler).Dispatch(0xc00037d700, {0x163f588, 0xc0002882d0}, 0xc0000b0420)
github.com/xtls/xray-core/app/proxyman/outbound/handler.go:211 +0x388
github.com/xtls/xray-core/app/dispatcher.(*DefaultDispatcher).routedDispatch(0xc00037b8c0, {0x163f588, 0xc0002882d0}, 0xc0000b0420, {{0x163f240, 0xc0002820e0}, 0x1bb, 0x2})
github.com/xtls/xray-core/app/dispatcher/default.go:486 +0xc26
github.com/xtls/xray-core/app/dispatcher.(*DefaultDispatcher).Dispatch.func1()
github.com/xtls/xray-core/app/dispatcher/default.go:295 +0x365
created by github.com/xtls/xray-core/app/dispatcher.(*DefaultDispatcher).Dispatch in goroutine 50
github.com/xtls/xray-core/app/dispatcher/default.go:268 +0x47b 而 localdns.Client 确实调用了 Go 原生的 |
我也不明确,我在其他操作系统上也没有出现该问题,你可以帮我检查一下吗?其他 Linux 发行版的 systemd-resolved 是否也只监听 |
看看你执行两个编译的时候go env? |
完整性要求
描述
当出站为 Freedom 时,根据日志推测,似乎它向
[::1]:53
请求 DNS,即便已配置内置 DNS 服务器。这让 Freedom 无法访问网络,因为 systemd-resolved 默认不监听::1
。我不清楚这是 Xray 的 bug 还是操作系统的问题。
仅 Freedom 存在该问题,其他出战无该问题
目前已知 2 个行为可以解决该问题,请开发者大佬们参考以定位问题
/etc/systemd/resolved.conf
并添加DNSStubListenerExtra=::1
/etc/hosts
并注释掉::1 localhost
补充信息:
重现方式
客户端配置
服务端配置
N/A
客户端日志
服务端日志
N/A
The text was updated successfully, but these errors were encountered: