1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2024-12-22 07:43:15 +00:00

Add standard DNS servers when removing local DNS servers

This commit is contained in:
M66B 2019-09-09 20:25:36 +02:00
parent 2e131bde1e
commit 0d0168aa34

View file

@ -1164,6 +1164,7 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
}
// Remove local DNS servers when not routing LAN
int count = listDns.size();
boolean lan = prefs.getBoolean("lan", false);
boolean use_hosts = prefs.getBoolean("use_hosts", false);
if (lan && use_hosts && filter)
@ -1199,7 +1200,7 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
}
// Always set DNS servers
if (listDns.size() == 0)
if (listDns.size() == 0 || listDns.size() < count)
try {
listDns.add(InetAddress.getByName("8.8.8.8"));
listDns.add(InetAddress.getByName("8.8.4.4"));