dnsjava usage

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.");
    }
}

原文地址:https://www.cnblogs.com/bluestorm/p/10348731.html

时间: 2024-10-11 00:08:22

dnsjava usage的相关文章

sharepoint 2013 开启 Usage and Health Data Collection

Usage and Health Data Collection Monitoring the status of your farm's health is a critical aspect of SharePoint administration. This service application collects the various logging information stored in SharePoint and writes it to the logging databa

[转]Disk Space Usage and SQL Server Performance

Disk Space Usage and SQL Server Performance By Gregory A. Larsen When you think of SQL Server performance components, you think of the usage of CPU, memory, and the I/O it takes to process a query. However, there is another component you should consi

CSS减肥的工具–Firefox插件 CSS Usage

首先,我们需要安装Firefox(猛击此处下载),或者确定你已经安装的版本已经高于3.1; 第二步,安装前端开发人员最普及的开发工具 Firebug: 第三步,安装CSS Usage 0.3.4.1: 第四步,在浏览器中打开我们要优化的页面(本地的页面也可以),点击右下角的firebug小图标,打开firebug工具窗口,我们会看到在工具选项中我们有一个 CSS Usage工具的按钮. 首先我们来分析最上面的三个功能按钮的使用 Scan: 通过字面意思我们就能知道,这是一个扫描当前页面的工具,如

【DataStructure】Description and usage of queue

[Description] A queue is a collection that implements the first-in-first-out protocal. This means that the only accessiable object in the collection in the first one that was inserted. The most common example of a queue is a waiting line. [Interface]

【DataStructure】One of queue usage: Simulation System

Statements: This blog was written by me, but most of content  is quoted from book[Data Structure with Java Hubbard] [Description] This simulationillustrates objectoriented programming(OOP). Java objects are instantiated to represent all the interacti

[转]printk usage

原文地址:http://elinux.org/Debugging_by_printing#Usage If variable is of Type, use printk format specifier: --------------------------------------------------------- int %d or %x unsigned int %u or %x long %ld or %lx unsigned long %lu or %lx long long %l

Windows 8 Disk Usage Keep up 100%

Recently i find the windows8 Disk Usage always keep up 100%, It must be have some issue. Step1. Go into Open Task Manager Step2. Go to Details tab Step3. Right click the columns headers and click "Select Columns" Step4. From the "Select Col

Linux tar command usage

Linux tar command usage */--> Linux tar command usage Table of Contents 1. Create an archive: 2. Create a gzipped archive: 3. List the files in an archive 4. Add a file or directory to an existing archive The frequently used tar command are listed as

A Complete Guide to Usage of ‘usermod’ command– 15 Practical Examples with Screenshots

https://www.tecmint.com/usermod-command-examples/ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- In Unix/Linux distribut