mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 07:01:05 +00:00
Better DNS lookup
This commit is contained in:
parent
c9d9061919
commit
2359276202
2 changed files with 5 additions and 2 deletions
|
@ -429,13 +429,14 @@ public class EmailProvider {
|
|||
Lookup lookup = new Lookup(dns, Type.SRV);
|
||||
|
||||
// https://dns.watch/ 84.200.69.80
|
||||
SimpleResolver resolver = new SimpleResolver("8.8.8.8");
|
||||
SimpleResolver resolver = new SimpleResolver(Helper.DEFAULT_DNS);
|
||||
lookup.setResolver(resolver);
|
||||
Log.i("Lookup dns=" + dns + " @" + resolver.getAddress());
|
||||
Record[] records = lookup.run();
|
||||
|
||||
if (lookup.getResult() != Lookup.SUCCESSFUL)
|
||||
if (lookup.getResult() == Lookup.HOST_NOT_FOUND)
|
||||
if (lookup.getResult() == Lookup.HOST_NOT_FOUND ||
|
||||
lookup.getResult() == Lookup.TYPE_NOT_FOUND)
|
||||
throw new UnknownHostException(dns);
|
||||
else
|
||||
throw new IllegalArgumentException(lookup.getErrorString());
|
||||
|
|
|
@ -114,6 +114,8 @@ public class Helper {
|
|||
|
||||
static final float LOW_LIGHT = 0.6f;
|
||||
|
||||
static final String DEFAULT_DNS = "8.8.8.8";
|
||||
|
||||
static final String FAQ_URI = "https://github.com/M66B/FairEmail/blob/master/FAQ.md";
|
||||
static final String XDA_URI = "https://forum.xda-developers.com/android/apps-games/source-email-t3824168";
|
||||
|
||||
|
|
Loading…
Reference in a new issue