Commit ee08f026 authored by Mygod's avatar Mygod

Use remote DNS for VPN

parent 7af26d1a
...@@ -74,7 +74,7 @@ class ShadowsocksNatService extends BaseService { ...@@ -74,7 +74,7 @@ class ShadowsocksNatService extends BaseService {
"-t", "10", "-t", "10",
"-b", "127.0.0.1", "-b", "127.0.0.1",
"-l", (profile.localPort + 63).toString, "-l", (profile.localPort + 63).toString,
"-L", if (profile.remoteDns == null) "8.8.8.8:53" else profile.remoteDns + ":53", "-L", profile.remoteDns + ":53",
"-c", buildShadowsocksConfig("ss-tunnel-nat.conf")) "-c", buildShadowsocksConfig("ss-tunnel-nat.conf"))
if (profile.udpdns) cmd.append("-u") if (profile.udpdns) cmd.append("-u")
......
...@@ -189,7 +189,7 @@ class ShadowsocksVpnService extends VpnService with BaseService { ...@@ -189,7 +189,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
"-t", "10", "-t", "10",
"-b", "127.0.0.1", "-b", "127.0.0.1",
"-l", (profile.localPort + 63).toString, "-l", (profile.localPort + 63).toString,
"-L" , if (profile.remoteDns == null) "8.8.8.8:53" else profile.remoteDns + ":53", "-L" , profile.remoteDns + ":53",
"-c", buildShadowsocksConfig("ss-tunnel-vpn.conf")).start() "-c", buildShadowsocksConfig("ss-tunnel-vpn.conf")).start()
def startDnsDaemon() { def startDnsDaemon() {
...@@ -221,7 +221,7 @@ class ShadowsocksVpnService extends VpnService with BaseService { ...@@ -221,7 +221,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") builder.addDnsServer(profile.remoteDns)
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