Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在阅读有关SURBL(已知垃圾邮件主机)的信息,以将垃圾邮件分类为批处理。主要访问方法似乎是通过 DNS 查找。我想知道从 Java 代码进行此类查找的常用方法是什么。由于这是一个没有严格性能要求的批处理过程,我认为最重要的功能就是简单。
你可以简单地做:
InetAddress.getByName("test.multi.surbl.org").getHostAddress();
如果无法解析主机名,则不会列出。如果可以解析,则 IP 地址的最后一个八位字节表示它的列出位置。
如果您需要更高级的功能,还有dnsjava 。例如,也许您也想检查 TXT 记录。