在Android上解决DNS SRV记录的轻量级方式 [英] Lightweight way to resolve DNS SRV records on Android

查看:212
本文介绍了在Android上解决DNS SRV记录的轻量级方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android上执行SRV记录查找的资源最有效的方法是什么?在XMPP客户端,如 yaxim

What is the most resource-efficient way to do SRV record lookups on Android, e.g. in an XMPP client like yaxim?

我知道:


  • JNDI ,它是JavaSE的一部分,但不在Android中。

  • dnsjava ,它增加了800 KB的类文件(在ProGuard之后是580KByte,所以可能很难分离只需要SRV查找的文件)

  • 如dig,nslookup等本机工具,当它们静态编译时,具有类似于dnsjava的脚本,并且还使您的应用程序本地代码依赖

  • JNDI, which is part of JavaSE but not in Android
  • dnsjava, which adds 800 KByte of class files (580KByte after ProGuard, so it will probably be hard to separate the files only needed for SRV lookup)
  • native tools like dig, nslookup, etc., which, when compiled statically, have a footprint similar to dnsjava and in addition make your app native-code dependant

我已阅读查询DNS服务记录以查找主机名和TCP / IP ,但只列出了JNDI和dnsjava。

I have read Querying the DNS service records to find the hostname and TCP/IP, but it only lists JNDI and dnsjava.

肯定我不是第一个遇到这个问题,并且必须有一些轻量级的DNS SRV解析器在Java: - )

For sure I am not the first one to encounter this problem and there must be some lightweight DNS SRV resolver in Java :-)

编辑:提供DNSSEC验证/ DANE证书查询的积分。

bonus points for providing DNSSEC verification / DANE certificate querying.

推荐答案

这可能有点晚了,但是提到这个问题可能有助于:

This might be a bit late, but a reference to this question may help:

Java DNS查找SRV记录

答案是使用外部库(最新版本,2015年2月) ,约为310KB,并在BSD许可证下。您可以在 http://www.dnsjava.org/download/ 找到它。这一切都属于一个JAR,它自1999年以来已经发布。

The answer there is using an external library (the most recent version, February 2015 as of this writing), is about 310KB, and under the BSD license. You can find it at http://www.dnsjava.org/download/. It all comes within one JAR, and it's been released since 1999.

这篇关于在Android上解决DNS SRV记录的轻量级方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆