Skip to content

Commit c2f0299

Browse files
committed
Refine DNS server with China List
1 parent 54247d6 commit c2f0299

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala

+6-1
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,16 @@ class ShadowsocksNatService extends BaseService {
136136
, "-u"
137137
, "-t" , "10"
138138
, "-b" , "127.0.0.1"
139-
, "-L" , "8.8.8.8:53"
140139
, "-l" , (profile.localPort + 53).toString
141140
, "-P" , getApplicationInfo.dataDir
142141
, "-c" , getApplicationInfo.dataDir + "/ss-tunnel-nat.conf")
143142

143+
cmd += "-L"
144+
if (profile.route == Route.CHINALIST)
145+
cmd += "114.114.114.114:53"
146+
else
147+
cmd += "8.8.8.8:53"
148+
144149
if (profile.auth) cmd += "-A"
145150

146151
if (BuildConfig.DEBUG) Log.d(TAG, cmd.mkString(" "))

src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala

+6-1
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,15 @@ class ShadowsocksVpnService extends VpnService with BaseService {
284284
, "-V"
285285
, "-t", "10"
286286
, "-b", "127.0.0.1"
287-
, "-L", "8.8.8.8:53"
288287
, "-P", getApplicationInfo.dataDir
289288
, "-c", getApplicationInfo.dataDir + "/ss-tunnel-vpn.conf")
290289

290+
cmd += "-L"
291+
if (profile.route == Route.CHINALIST)
292+
cmd += "114.114.114.114:53"
293+
else
294+
cmd += "8.8.8.8:53"
295+
291296
if (profile.auth) cmd += "-A"
292297

293298
if (BuildConfig.DEBUG) Log.d(TAG, cmd.mkString(" "))

0 commit comments

Comments
 (0)