Skip to content

Commit ef22599

Browse files
committed
TProxyService: Add mapdns section when remote DNS is enabled.
1 parent baa91ad commit ef22599

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

app/src/main/java/hev/sockstun/TProxyService.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,14 @@ public void startService() {
148148
tproxy_conf += " password: '" + prefs.getSocksPassword() + "'\n";
149149
}
150150

151-
tproxy_conf += "mapdns:\n" +
152-
" address: " + prefs.getMappedDns() + "\n" +
153-
" port: 53\n" +
154-
" network: 240.0.0.0\n" +
155-
" netmask: 240.0.0.0\n" +
156-
" cache-size: 10000\n";
151+
if (prefs.getRemoteDns()) {
152+
tproxy_conf += "mapdns:\n" +
153+
" address: " + prefs.getMappedDns() + "\n" +
154+
" port: 53\n" +
155+
" network: 240.0.0.0\n" +
156+
" netmask: 240.0.0.0\n" +
157+
" cache-size: 10000\n";
158+
}
157159

158160
fos.write(tproxy_conf.getBytes());
159161
fos.close();

0 commit comments

Comments
 (0)