shadowsocks / shadowsocks-android

A shadowsocks client for Android
Other
35.23k stars 11.57k forks source link

有没有方法配置代理不使用local dns #2726

Closed mokitoo closed 3 years ago

mokitoo commented 3 years ago

Is your feature request related to a problem? Please describe. 目前的这个版本,vpn模式下,后台拿到的都是ip,看起来好像是local dns已经缓存了 看以前老版本里面,即使配置了远程dns,后台还是可以请求到域名

mokitoo commented 3 years ago

看了下好像是本地有个localDns的server,不知道这个localDns修改哪里可以关掉

mokitoo commented 3 years ago

试了下去掉local DNS proxy (把dnsRelay设置为false),好像直接就不能用了 @madeye @Mygod

ProxyInstance.kt

// local DNS proxy
            if (dnsRelay) try {
                URI("dns://${profile.remoteDns}")
            } catch (e: URISyntaxException) {
                throw BaseService.ExpectedExceptionWrapper(e)
            }.let { dns ->
                put(JSONObject().apply {
                    put("local_address", DataStore.listenAddress)
                    put("local_port", DataStore.portLocalDns)
                    put("local_dns_address", "local_dns_path")
                    put("remote_dns_address", dns.host ?: "0.0.0.0")
                    put("remote_dns_port", if (dns.port < 0) 53 else dns.port)
                    put("protocol", "dns")
                })
            }