Commit bc0b5030 authored by Mygod's avatar Mygod

Fix DNS leakage

Fix #1397. Tested via dnsleaktest.com.
parent 81b7add2
...@@ -186,7 +186,7 @@ class ShadowsocksVpnService extends VpnService with BaseService { ...@@ -186,7 +186,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
.setMtu(VPN_MTU) .setMtu(VPN_MTU)
.addAddress(PRIVATE_VLAN.formatLocal(Locale.ENGLISH, "1"), 24) .addAddress(PRIVATE_VLAN.formatLocal(Locale.ENGLISH, "1"), 24)
builder.addDnsServer("8.8.8.8") // It's fake DNS for tun2socks, not the real remote DNS profile.remoteDns.split(",").foreach(dns => builder.addDnsServer(dns.trim))
if (profile.ipv6) { if (profile.ipv6) {
builder.addAddress(PRIVATE_VLAN6.formatLocal(Locale.ENGLISH, "1"), 126) builder.addAddress(PRIVATE_VLAN6.formatLocal(Locale.ENGLISH, "1"), 126)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment