mirror of https://github.com/M66B/NetGuard.git
Simpler DNS server check
This commit is contained in:
parent
d460404d59
commit
52ceccd12b
|
@ -756,7 +756,8 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS
|
|||
if (TextUtils.isEmpty(vpnDns.trim()))
|
||||
throw new UnknownHostException("dns");
|
||||
InetAddress dns = InetAddress.getByName(vpnDns);
|
||||
if (dns.isAnyLocalAddress() || dns.isLinkLocalAddress() || dns.isLoopbackAddress())
|
||||
// Check legacy settings
|
||||
if (dns.isLoopbackAddress() || dns.isAnyLocalAddress())
|
||||
throw new UnknownHostException("dns");
|
||||
Log.i(TAG, "DNS using=" + dns);
|
||||
return dns;
|
||||
|
|
Loading…
Reference in New Issue