海外的Android端产品,使用happy-dns-android项目解决DNS解析失败,请推荐最优的使用配置。
官网上,给出的是:
IResolver[] resolvers = new IResolver[2];
resolvers[0] = AndroidDnsServer.defaultResolver(getContext());
resolvers[1] = new DnsUdpResolver("8.8.8.8");
dns = new DnsManager(NetworkInfo.normal, resolvers);
以下的配置是否更优,或者有更好的配置方式吗?
IResolver[] resolvers = new IResolver[3];
resolvers[0] = AndroidDnsServer.defaultResolver(getContext());
resolvers[1] = new DnsUdpResolver("8.8.8.8");
resolvers[2] = new DnhResolver("https://dns.alidns.com/dns-query");
dns = new DnsManager(NetworkInfo.normal, resolvers);
IResolver[] resolvers = new IResolver[3];
resolvers[0] = new DnsUdpResolver("8.8.8.8");
resolvers[1] = new DnhResolver("https://dns.alidns.com/dns-query");
resolvers[2] = AndroidDnsServer.defaultResolver(getContext());
dns = new DnsManager(NetworkInfo.normal, resolvers);