XTLS / Xray-core

Xray, Penetrates Everything. Also the best v2ray-core, with XTLS support. Fully compatible configuration.
https://t.me/projectXray
Mozilla Public License 2.0
24k stars 3.78k forks source link

安卓手机xray模块无法正确dns到localhost #3416

Closed SatenRuiko-Lv0 closed 2 months ago

SatenRuiko-Lv0 commented 2 months ago

预期:cn类的域名dns查询走localhost,但是查询失败。不知道这是bug还是什么其他的原因,请大佬轻喷,感谢🙏🏻 配置如下 { "log": { "access": "/data/防跳/v2ray/access.log", "error": "/data/防跳/v2ray/error.log", "loglevel": "info", "dnsLog": true } , "dns": { "servers": [ "localhost", { "address": "tcp+local://8.8.8.8", "port": 53, "domains": ["geosite:geolocation-!cn"] } ], "tag": "resolve", "queryStrategy": "UseIPv4" }, "inbounds": [{ "tag": "socks-in", "port": 10800, "protocol": "socks", "settings": { "network": "tcp,udp", "udp": true }, "sniffing": { "enabled": true, "destOverride": ["http", "tls", "quic"], "ipsExcluded": ["geoip:cn"] } }], "routing": { "domainStrategy": "AsIs", "domainMatcher": "hybrid", "rules": [{ "type": "field", "inboundTag": ["socks-in"], "port": "53,5353", "outboundTag": "dns-out" }, { "type": "field", "inboundTag": ["socks-in"], "domain": ["domain:googleapis.cn"], "balancerTag": "global-balancers" }, { "type": "field", "inboundTag": ["socks-in"], "ip": ["geoip:cn"], "balancerTag": "cn-balancers" }, { "type": "field", "inboundTag": ["socks-in"], "domain": ["geosite:cn"], "balancerTag": "cn-balancers" }, { "type": "field", "inboundTag": ["socks-in"], "balancerTag": "global-balancers" }], "balancers": [{ "tag": "global-balancers", "selector": ["global-out"], "strategy": { "type": "random" } }, { "tag": "cn-balancers", "selector": ["cn-out"], "strategy": { "type": "random" } }] }, "outbounds": [{ "protocol": "vmess", "tag": "global-out0", "settings": { "vnext": [{ "address": "xxx", "port": 80, "users": [{ "id": "xxx", "alterId": 0, "security": "auto", "flow": "", "encryption": "none" }] }] }, "mux": { "enabled": true, "concurrency": 4, "xudpConcurrency": 6, "xudpProxyUDP443": "allow" }, "streamSettings": { "sockopt": { "tcpFastOpen": false, "tcpKeepAliveInterval": 15 }, "network": "ws", "wsSettings": { "path": "/", "headers": { "Host": "gw.alicdn.com" } }, "security": "none", "tlsSettings": {} } }, { "protocol": "vmess", "tag": "cn-out0", "settings": { "vnext": [{ "address": "xxx", "port": 80, "users": [{ "id": "xxx", "alterId": 0, "security": "auto", "flow": "", "encryption": "none" }] }] }, "mux": { "enabled": true, "concurrency": 4, "xudpConcurrency": 6, "xudpProxyUDP443": "allow" }, "streamSettings": { "sockopt": { "tcpFastOpen": false, "tcpKeepAliveInterval": 15 }, "network": "ws", "wsSettings": { "path": "/", "headers": { "Host": "gw.alicdn.com" } }, "security": "none", "tlsSettings": {} } }, { "protocol": "dns", "tag": "dns-out" }, { "protocol": "freedom", "tag": "no-proxy", "settings": { "domainStrategy": "UseIP" } }, { "protocol": "blackhole", "tag": "denyNetwork" }], "observatory": {} } 报错信息 2024/06/03 20:40:26 [Info] app/dns: DNS: created localhost client 2024/06/03 20:40:26 [Info] transport/internet/tcp: listening TCP on 0.0.0.0:10800 2024/06/03 20:40:26 [Info] transport/internet/udp: listening UDP on 0.0.0.0:10800 2024/06/03 20:40:26 [Warning] core: Xray 1.8.13 started 2024/06/03 20:40:27 [Info] [3054126285] app/proxyman/inbound: connection ends > proxy/socks: failed to read request > proxy/socks: unknown Socks version: 71 2024/06/03 20:40:27 [Info] [3222281253] proxy/socks: client UDP connection from udp:127.0.0.1:39191 2024/06/03 20:40:27 [Info] transport/internet/udp: establishing new connection for udp:221.11.1.67:53 2024/06/03 20:40:27 [Info] [3222281253] app/dispatcher: taking detour [dns-out] for [udp:221.11.1.67:53] 2024/06/03 20:40:27 [Info] [3222281253] proxy/dns: handling DNS traffic to udp:221.11.1.67:53 2024/06/03 20:40:28 [Info] app/dns: TCPL//8.8.8.8:53 got answer: time.apple.com. TypeA -> [17.253.84.123 17.253.84.251 17.253.116.253] 194.975364ms 2024/06/03 20:41:44 [Info] transport/internet/udp: establishing new connection for udp:221.11.1.67:53 2024/06/03 20:41:44 [Info] [1539071446] app/dispatcher: taking detour [dns-out] for [udp:221.11.1.67:53] 2024/06/03 20:41:44 [Info] [1539071446] proxy/dns: handling DNS traffic to udp:221.11.1.67:53 2024/06/03 20:41:44 [Info] app/dns: failed to lookup ip for domain browserapi.micloud.xiaomi.net at server localhost > lookup browserapi.micloud.xiaomi.net on [::1]:53: read udp [::1]:38770->[::1]:53: read: connection refused 2024/06/03 20:41:44 [Info] proxy/dns: ip query > lookup browserapi.micloud.xiaomi.net on [::1]:53: read udp [::1]:38770->[::1]:53: read: connection refused 2024/06/03 20:41:44 [Info] [820173442] proxy/socks: client UDP connection from udp:127.0.0.1:37292 2024/06/03 20:41:44 [Info] transport/internet/udp: establishing new connection for udp:221.11.1.68:53 2024/06/03 20:41:44 [Info] [820173442] app/dispatcher: taking detour [dns-out] for [udp:221.11.1.68:53] 2024/06/03 20:41:44 [Info] [820173442] proxy/dns: handling DNS traffic to udp:221.11.1.68:53 2024/06/03 20:41:45 [Info] app/dns: failed to lookup ip for domain browserapi.micloud.xiaomi.net at server localhost > lookup browserapi.micloud.xiaomi.net on [::1]:53: read udp [::1]:38510->[::1]:53: read: connection refused 2024/06/03 20:41:45 [Info] proxy/dns: ip query > lookup browserapi.micloud.xiaomi.net on [::1]:53: read udp [::1]:38510->[::1]:53: read: connection refused 2024/06/03 20:41:45 [Info] app/dns: failed to lookup ip for domain ws-keyboard.shouji.sogou.com at server localhost > lookup ws-keyboard.shouji.sogou.com on [::1]:53: read udp [::1]:41439->[::1]:53: read: connection refused 2024/06/03 20:41:45 [Info] proxy/dns: ip query > lookup ws-keyboard.shouji.sogou.com on [::1]:53: read udp [::1]:41439->[::1]:53: read: connection refused

SatenRuiko-Lv0 commented 2 months ago

求解惑,非常感谢🙏🏻

Fangliding commented 2 months ago

安卓上又没有 systemd-resolved 127.0.0.1:53 上自然没有dns服务