linux dig 命令使用方法

https://www.imooc.com/article/26971?block_id=tuijian_wz

https://jimwayne.blogspot.com/2012/08/java-dnsjava-dns-query.html

http://dnsjava.org

http://www.dnsjava.org/download/

http://www.xbill.org/dnsjava/dnsjava-current/examples.html

import java.net.InetAddress;
import java.net.UnknownHostException; import org.xbill.DNS.*; public class NetWork {
public static void main(String[] args) throws UnknownHostException, TextParseException {
InetAddress address = InetAddress.getByName("baidu.com");
System.out.println(address.getHostAddress()); //查询域名对应的IP地址
Lookup lookup = new Lookup("baidu.com", Type.A); // Print the DNS server used by dnsjava
String[] resolvers = ResolverConfig.getCurrentConfig().servers();
for (int i = 0; i < resolvers.length; i++) {
System.out.println("Reslover's default: " + resolvers[i]);
} // Send DNS query
lookup.run();
if (lookup.getResult() != Lookup.SUCCESSFUL) {
System.out.println("ERROR: " + lookup.getErrorString());
return;
}
Record[] answers = lookup.getAnswers();
for(Record rec : answers){
System.out.println(rec.toString());
}
System.out.println("Searching complete.");
}
}

dnsjava usage的更多相关文章

  1. intellij IDEA 出现“Usage of API documented as @since 1.6+”的解决办法

    问题 在导入java.io.console的时候出现"Usage of API documented as @since 1.6+"

  2. Disk Space Usage 术语理解:unallocated, unused and reserved

    通过standard reports查看Disk Usage,选中Database,右击,选择Reports->Standard Reports->Disk Space Usage,截图如 ...

  3. OpenCascade MeshVS Usage

    OpenCascade MeshVS Usage eryar@163.com Abstract. MeshVS means Mesh Visualization Service. It can be ...

  4. Usage: AddDimensionedImage imageFile outputFile eclipse 运行程序出错

    关于这个在eclipse中运行java程序的错,首先确认你的jdk,jre是否完整,并且与你的eclipse的位数相同,当然我相信这个错误大家应该都会去检查到. 第二个关于addDimensioned ...

  5. Please allow Subclipse team to receive anonymous usage statistics for this Eclipse intance(info)

    本文转载自:http://blog.csdn.net/myfxx/article/details/21096949 今天在用eclipse启动项目的时候发现了一个问题,就是每次启动项目的时候,ecli ...

  6. [转]Dynamic SQL & Stored Procedure Usage in T-SQL

    转自:http://www.sqlusa.com/bestpractices/training/scripts/dynamicsql/ Dynamic SQL & Stored Procedu ...

  7. 处理Linux下subversion尝试连接自建的VisualSVN server报“Key usage violation in certificate has been detected”错误的问题

    在Linux下使用subversion尝试链接VisualSVN server搭建的svn库,可能会报下面错误, svn: OPTIONS of 'https://server.domain.loca ...

  8. 应用alter index ××× monitoring usage;语句监控索引使用与否

    随着时间的累积,在没有很好的规划的情况下,数据库中也许会存在大量长期不被使用的索引,如果快速的定位这些索引以便清理便摆在案头.我们可以使用"alter index ××× monitorin ...

  9. hadoop 2.5 hdfs namenode –format 出错Usage: java NameNode [-backup] |

    在 cd  /home/hadoop/hadoop-2.5.2/bin 下 执行的./hdfs namenode -format 报错[hadoop@node1 bin]$ ./hdfs nameno ...

随机推荐

  1. C# 读取驱动器盘符及信息

    System.IO.DriveInfo[] hardDiskDrives = System.IO.DriveInfo.GetDrives(); foreach (System.IO.DriveInfo ...

  2. Linux自动人机交互expect

    exp_test.sh文件 #!/bin/bash/expect ## exp_test.sh set timeout -; spawn ssh localhost; expect { "( ...

  3. [PHP]curl上传多文件

    码一下curl上传多文件的行 5.5之前版本的写法 $file = array( 'pic[0]'=>"@E:\\wwwroot\\10003\\temp_56.ini;type=te ...

  4. ubuntu安装jdk8

    文章连接:https://www.cnblogs.com/lighten/p/6105463.html 1.简单的安装方法 安装JDK的最简单方法应该就是使用apt-get来安装了,但是源一般是Ope ...

  5. 用layui前端框架弹出form表单以及提交

    第一步:引用两个文件 第二步:点击删除按钮弹出提示框 /*删除开始*/ $(".del").click(function () { var id = $(this).attr(&q ...

  6. Codeforces 438E The Child and Binary Tree [DP,生成函数,NTT]

    洛谷 Codeforces 思路 看到计数和\(998244353\),可以感觉到这是一个DP+生成函数+NTT的题. 设\(s_i\)表示\(i\)是否在集合中,\(A\)为\(s\)的生成函数,即 ...

  7. Confluence 6 在编辑器中控制参数的显示

    你可以决定宏参数在 Confluence 编辑器中如何进行显示的. 在默认的情况下,在宏占位符下尽可能显示能显示的所有参数: 你可以控制这里显示的参数数量,通过这种控制你可能尽量的为编辑者提供有效的信 ...

  8. 关于python3链接虚拟机MongoDB 遇到的问题总结

    pymongo.errors.ServerSelectionTimeoutError: 192.168.12.230:27017: [Errno 61] Connection refused 1.如果 ...

  9. <<人月神话>>阅读体会(一)

    第一次听说人月神话还是在大一上学期的导论课那会儿,那会儿好像就已经确定了自己要学软件,于是就去问王建民老师能不能给我推荐几本软件工程方面的书,我想要提前自己学学,以为老师会给我推荐一些某种语言类的学习 ...

  10. selenium关于断言的使用

    基本介绍: Selenium工具专门为WEB应用程序编写的一个验收测试工具. Selenium的核心:browser bot,是用JAVASCRIPT编写的. Selenium工具有4种:Seleni ...