Skip to content
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

启用该模块后似乎无法正常使用 localhost 作为内置 dns 的 server #86

Open
Aniark opened this issue Oct 23, 2022 · 4 comments

Comments

@Aniark
Copy link

Aniark commented Oct 23, 2022

DNS 配置,!cn 域名使用 fakedns 解析,cn 则使用 localhost 解析
"dns": {
"servers": [
{
"address": "fakedns",
"domains": ["geosite:geolocation-!cn"]
},
{
"address": "localhost",
"domains": ["geosite:cn", "geosite:geolocation-cn"]
}
],
"tag": "dns",
"queryStrategy": "UseIP"
}

预期情况:cn 域名将由 localhost 解析
实际情况:cn 域名一律无法正常解析,只有 !cn 域名正常解析

后来发现同样的 dns 配置,在 v2rayng 能正常使用,在 Xray4Magisk 下会出错,报错日志:2022/10/23 04:10:30 [Info] app/dns: failed to lookup ip for domain fanyi.baidu.com at server localhost > lookup fanyi.baidu.com on [::1]:53: dial udp [::1]:53: connect: cannot assign requested address

联动 XTLS/Xray-core#1265

@CerteKim
Copy link
Collaborator

@Aniark 不要使用 "address": "localhost" ,若要使用请开启 CGO 编译 *ray 替换原核心。

@Aniark
Copy link
Author

Aniark commented Oct 23, 2022

@Aniark 不要使用 "address": "localhost" ,若要使用请开启 CGO 编译 *ray 替换原核心。

收到,我这就去试试

@Aniark
Copy link
Author

Aniark commented Oct 23, 2022

@CerteKim 测试完毕, CGO 编译 的 xray-core 虽然日志里没有报错,但是依然无法正常解析 cn 域名,表现为访问 cn 域名会载入很久,最后以浏览器报错告终: ERR_NAME_NOT_RESOLVED 。日志如下

Xray 1.6.1 (Xray, Penetrates Everything.) fbb0f12 (go1.19.2 android/arm64)
A unified platform for anti-censorship.
2022/10/23 17:48:17 [Info] infra/conf/serial: Reading config: /data/adb/xray/confs/config.json
2022/10/23 17:48:17 [Debug] app/log: Logger started
2022/10/23 17:48:17 [Info] app/dns: DNS: created localhost client
2022/10/23 17:48:17 [Info] app/dns: DNS: created localhost client
2022/10/23 17:48:17 [Debug] app/proxyman/inbound: creating stream worker on 0.0.0.0:65535
2022/10/23 17:48:17 [Info] transport/internet/tcp: listening TCP on 0.0.0.0:65535
2022/10/23 17:48:17 [Info] transport/internet/udp: listening UDP on 0.0.0.0:65535
2022/10/23 17:48:17 [Warning] core: Xray 1.6.1 started
2022/10/23 17:48:19 [Debug] transport/internet/udp: UDP original destination: udp:221.7.136.69:53
2022/10/23 17:48:19 [Debug] [4067364199] proxy/dokodemo: processing connection from: 10.176.141.205:25016
2022/10/23 17:48:19 [Info] [4067364199] proxy/dokodemo: received request for 10.176.141.205:25016
2022/10/23 17:48:19 [Info] [4067364199] app/dispatcher: taking detour [dns-out] for [udp:221.7.136.69:53]
2022/10/23 17:48:19 [Info] [4067364199] proxy/dns: handling DNS traffic to udp:null:53
2022/10/23 17:48:19 [Debug] app/dns: domain data.flurry.com will use DNS in order: [localhost FakeDNS localhost]
2022/10/23 17:48:19 [Debug] transport/internet/udp: UDP original destination: udp:221.7.136.69:53
2022/10/23 17:48:19 [Debug] [2794502087] proxy/dokodemo: processing connection from: 10.176.141.205:12161
2022/10/23 17:48:19 [Info] [2794502087] proxy/dokodemo: received request for 10.176.141.205:12161
2022/10/23 17:48:19 [Info] [2794502087] app/dispatcher: taking detour [dns-out] for [udp:221.7.136.69:53]
2022/10/23 17:48:19 [Info] [2794502087] proxy/dns: handling DNS traffic to udp:null:53
2022/10/23 17:48:19 [Debug] app/dns: domain data.flurry.com will use DNS in order: [localhost FakeDNS localhost]
2022/10/23 17:48:20 [Debug] transport/internet/udp: UDP original destination: udp:221.7.136.69:53
2022/10/23 17:48:20 [Debug] [1806605887] proxy/dokodemo: processing connection from: 10.176.141.205:1801
2022/10/23 17:48:20 [Info] [1806605887] proxy/dokodemo: received request for 10.176.141.205:1801
2022/10/23 17:48:20 [Info] [1806605887] app/dispatcher: taking detour [dns-out] for [udp:221.7.136.69:53]
2022/10/23 17:48:20 [Info] [1806605887] proxy/dns: handling DNS traffic to udp:null:53
2022/10/23 17:48:20 [Debug] app/dns: domain fanyi.baidu.com matches following rules: [geosite:cn(DNS idx:0)]
2022/10/23 17:48:20 [Debug] app/dns: domain fanyi.baidu.com will use DNS in order: [localhost FakeDNS localhost]
2022/10/23 17:48:24 [Debug] transport/internet/udp: UDP original destination: udp:221.7.128.69:53
2022/10/23 17:48:24 [Debug] transport/internet/udp: UDP original destination: udp:221.7.128.69:53
2022/10/23 17:48:24 [Debug] [116952452] proxy/dokodemo: processing connection from: 10.176.141.205:22501
2022/10/23 17:48:24 [Info] [116952452] proxy/dokodemo: received request for 10.176.141.205:22501
2022/10/23 17:48:24 [Debug] [3503571715] proxy/dokodemo: processing connection from: 10.176.141.205:27613
2022/10/23 17:48:24 [Info] [3503571715] proxy/dokodemo: received request for 10.176.141.205:27613
2022/10/23 17:48:24 [Info] [116952452] app/dispatcher: taking detour [dns-out] for [udp:221.7.128.69:53]
2022/10/23 17:48:24 [Info] [116952452] proxy/dns: handling DNS traffic to udp:null:53
2022/10/23 17:48:24 [Info] [3503571715] app/dispatcher: taking detour [dns-out] for [udp:221.7.128.69:53]
2022/10/23 17:48:24 [Info] [3503571715] proxy/dns: handling DNS traffic to udp:null:53
2022/10/23 17:48:24 [Debug] app/dns: domain data.flurry.com will use DNS in order: [localhost FakeDNS localhost]
2022/10/23 17:48:24 [Debug] app/dns: domain data.flurry.com will use DNS in order: [localhost FakeDNS localhost]
2022/10/23 17:48:26 [Debug] transport/internet/udp: UDP original destination: udp:221.7.128.69:53
2022/10/23 17:48:26 [Debug] [3011575510] proxy/dokodemo: processing connection from: 10.176.141.205:7845
2022/10/23 17:48:26 [Info] [3011575510] proxy/dokodemo: received request for 10.176.141.205:7845
2022/10/23 17:48:26 [Info] [3011575510] app/dispatcher: taking detour [dns-out] for [udp:221.7.128.69:53]
2022/10/23 17:48:26 [Info] [3011575510] proxy/dns: handling DNS traffic to udp:null:53
2022/10/23 17:48:26 [Debug] app/dns: domain fanyi.baidu.com matches following rules: [geosite:cn(DNS idx:0)]
2022/10/23 17:48:26 [Debug] app/dns: domain fanyi.baidu.com will use DNS in order: [localhost FakeDNS localhost]
2022/10/23 17:48:26 [Debug] transport/internet/udp: UDP original destination: udp:[2408:8001:4010:9000:221:7:136:69]:53
2022/10/23 17:48:26 [Debug] transport/internet/udp: UDP original destination: udp:[2408:8001:4010:9000:221:7:136:69]:53
2022/10/23 17:48:26 [Debug] [2488958165] proxy/dokodemo: processing connection from: [2408:845c:512:86ab:8d4a:c202:f990:585b]:13447
2022/10/23 17:48:26 [Info] [2488958165] proxy/dokodemo: received request for [2408:845c:512:86ab:8d4a:c202:f990:585b]:13447
2022/10/23 17:48:26 [Debug] [4114552233] proxy/dokodemo: processing connection from: [2408:845c:512:86ab:8d4a:c202:f990:585b]:27828
2022/10/23 17:48:26 [Info] [4114552233] proxy/dokodemo: received request for [2408:845c:512:86ab:8d4a:c202:f990:585b]:27828
2022/10/23 17:48:26 [Info] [2488958165] app/dispatcher: taking detour [dns-out] for [udp:[2408:8001:4010:9000:221:7:136:69]:53]
2022/10/23 17:48:26 [Info] [2488958165] proxy/dns: handling DNS traffic to udp:null:53
2022/10/23 17:48:26 [Info] [4114552233] app/dispatcher: taking detour [dns-out] for [udp:[2408:8001:4010:9000:221:7:136:69]:53]
2022/10/23 17:48:26 [Info] [4114552233] proxy/dns: handling DNS traffic to udp:null:53
2022/10/23 17:48:26 [Debug] app/dns: domain data.flurry.com will use DNS in order: [localhost FakeDNS localhost]
2022/10/23 17:48:26 [Debug] app/dns: domain data.flurry.com will use DNS in order: [localhost FakeDNS localhost]
2022/10/23 17:48:28 [Debug] transport/internet/udp: UDP original destination: udp:[2408:8001:4010:9000:221:7:136:69]:53
2022/10/23 17:48:28 [Debug] [1228139514] proxy/dokodemo: processing connection from: [2408:845c:512:86ab:8d4a:c202:f990:585b]:32332
2022/10/23 17:48:28 [Info] [1228139514] proxy/dokodemo: received request for [2408:845c:512:86ab:8d4a:c202:f990:585b]:32332
2022/10/23 17:48:28 [Info] [1228139514] app/dispatcher: taking detour [dns-out] for [udp:[2408:8001:4010:9000:221:7:136:69]:53]
2022/10/23 17:48:28 [Info] [1228139514] proxy/dns: handling DNS traffic to udp:null:53

@CerteKim
Copy link
Collaborator

看到大量 proxy/dns: handling DNS traffic to udp:null:53,这里应该是出现了新的问题。

@whalechoi whalechoi pinned this issue Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants