Forward DNS packet to dnsgw

This commit is contained in:
Max Lv
2017-05-10 22:08:23 +08:00
parent 9ab9230960
commit a64eb8ac58
3 changed files with 4 additions and 4 deletions
@@ -317,7 +317,7 @@ trait BaseService extends Service {
protected final def buildOvertureConfig(file: String): String = {
val config = new JSONObject()
.put("BindAddress", "0.0.0.0:" + (profile.localPort + 53))
.put("BindAddress", "127.0.0.1:" + (profile.localPort + 53))
.put("RedirectIPv6Record", true)
.put("DomainBase64Decode", true)
.put("HostsFile", "hosts")
@@ -143,7 +143,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
/** Called when the activity is first created. */
def handleConnection() {
startShadowsocksDaemon()
if (!profile.udpdns) {
@@ -247,7 +247,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
cmd += "--enable-udprelay"
if (!profile.udpdns)
cmd += ("--dnsgw", "%s:%d".formatLocal(Locale.ENGLISH, PRIVATE_VLAN.formatLocal(Locale.ENGLISH, "1"),
cmd += ("--dnsgw", "%s:%d".formatLocal(Locale.ENGLISH, "127.0.0.1",
profile.localPort + 53))
tun2socksProcess = new GuardedProcess(cmd: _*).start(() => sendFd(fd))