海外Android端产品 happy-dns-android如何配置?

新手上路,请多包涵

海外的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);
阅读 310
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏