Fallback to system DNS

This commit is contained in:
M66B 2016-01-26 06:50:18 +01:00
parent c74455c4b6
commit e8ba6e24f5
1 changed files with 6 additions and 1 deletions

View File

@ -670,7 +670,12 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS
String sysDns = Util.getDefaultDNS(SinkholeService.this);
String vpnDns = prefs.getString("dns", sysDns);
Log.i(TAG, "DNS system=" + sysDns + " VPN=" + vpnDns);
builder.addDnsServer(vpnDns);
try {
builder.addDnsServer(vpnDns);
} catch (Throwable ex) {
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
builder.addDnsServer(sysDns);
}
}
if (tethering) {