How to use custom DNS DOH for android vpn?
Closed this issue · 0 comments
musqdp commented
I attempted to use an IP address that employs Xray to establish a SOCKS5 proxy, but it had no effect.
public class XrayVpnService extends VpnService {
private void setup() {
***
Builder builder = new Builder();
builder.addDnsServer("26.26.26.2");
***
}
}
Here's an example of the DNS config.json I utilized:
"dns" {
"hosts": {
"dns.nextdns.io": ["192.121.87.101","38.175.115.137"]
},
"servers": ["https://dns.nextdns.io/yourid"],
"queryStrategy": "UseIPv4",
"disableCache": true,
"disableFallback": true,
"disableFallbackIfMatch": true,
"tag": "dns"
}
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [ {
"port": "53,18303,853",
"outboundTag": "dns",
"type": "field"
}, {
"inboundTag": ["dns"],
"outboundTag": "proxy",
"type": "field"
}, {
"type": "field",
"ip": ["1.1.1.1", "10.0.2.3", "0.0.0.0"],
"outboundTag": "blackhole"
}
]
}