Update DoH
This commit is contained in:
1 file changed
+7
-17
@@ -73,20 +73,7 @@ public class EhDns implements Dns {
|
||||
hosts = EhApplication.getHosts(context);
|
||||
DnsOverHttps.Builder builder = new DnsOverHttps.Builder()
|
||||
.client(new OkHttpClient.Builder().cache(EhApplication.getOkHttpCache(context)).build())
|
||||
.url(HttpUrl.get("https://cloudflare-dns.com/dns-query"));
|
||||
try {
|
||||
builder.bootstrapDnsHosts(InetAddress.getByName("162.159.36.1"),
|
||||
InetAddress.getByName("162.159.46.1"),
|
||||
InetAddress.getByName("1.1.1.1"),
|
||||
InetAddress.getByName("1.0.0.1"),
|
||||
InetAddress.getByName("162.159.132.53"),
|
||||
InetAddress.getByName("2606:4700:4700::1111"),
|
||||
InetAddress.getByName("2606:4700:4700::1001"),
|
||||
InetAddress.getByName("2606:4700:4700::0064"),
|
||||
InetAddress.getByName("2606:4700:4700::6400"));
|
||||
} catch (UnknownHostException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
.url(HttpUrl.get("https://1.1.1.1/dns-query"));
|
||||
dnsOverHttps = builder.post(true).build();
|
||||
}
|
||||
|
||||
@@ -112,9 +99,12 @@ public class EhDns implements Dns {
|
||||
}
|
||||
}
|
||||
if (Settings.getDoH()) {
|
||||
inetAddresses = dnsOverHttps.lookup(hostname);
|
||||
if (inetAddresses.size() > 0) {
|
||||
return inetAddresses;
|
||||
try {
|
||||
inetAddresses = dnsOverHttps.lookup(hostname);
|
||||
if (inetAddresses.size() > 0) {
|
||||
return inetAddresses;
|
||||
}
|
||||
} catch (UnknownHostException ignore) {
|
||||
}
|
||||
}
|
||||
return SYSTEM.lookup(hostname);
|
||||
|
||||
Reference in new issue
Block a user