Detailed explanation of dig command

The dig command is a common domain name query tool that can be used to test whether the domain name system is working properly

grammar

1 dig (options) (parameters)

Options

1 @ < server address > : specify the domain name server for domain name resolution;
 2  - b < ip address > : when the host has multiple IP addresses, specify which IP address of the machine is used to send the domain name query request to the domain name server;
 3  - f < file name > : specify that dig runs in batch mode, and the specified file saves the DNS task information that needs batch query;
 4  - P: specifies the port number used by the domain name server;
 5  - t < type > : specifies the Query DNS data type;
 6  - x < IP address > : perform reverse domain name lookup;
 7-4  : use IPv4;
 8-6 : use IPv6;
 9 - h : display command help information.  

parameter

1  host: specify the host to query the domain name;
 2  query type: specify the type of DNS query;
 3  query class: specify the class to query DNS;
 4 query options: specify query options.

example

[ root@Zhe_JinHua_EDU_01 data ] # dig @114 . 114.114 . 114 www.baidu.com

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.62.rc1.el6 <<>> @114.114.114.114 www.baidu.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46432
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.baidu.com.            IN    A

;; ANSWER SECTION:
www.baidu.com.        116    IN    CNAME    www.a.shifen.com.
www.a.shifen.com.    202    IN    A    180.97.33.107
www.a.shifen.com.    202    IN    A    180.97.33.108

;; Query time: 58 msec
;; SERVER: 114.114.114.114#53(114.114.114.114)
;; WHEN: Tue Apr 17 02:44:40 2018
;; MSG SIZE  rcvd: 90

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324619509&siteId=291194637