Dig command
Function description
Dig and Nslookup, as well as the Domain name Query tool, is used to test the domain Name system is working properly. These two commands are all under the Bind-utils package, dig use is more convenient than Nslookup. Use the following:
dig [parameters] [options] |
Common parameters
Options |
Description |
@server |
If you do not want to use/etc/resolv.conf as the DNS host, you can fill in the other IP |
-T (Type) |
Specify query type |
-X |
Reverse Query |
+short |
Provide a short reply, the default is long |
Example
domain name resolves to an IP address
[Email protected] ~]# dig-t A www.baidu.com
; <<>> DiG 9.9.4-redhat-9.9.4-29.el7_2.4 <<>>-T A www.baidu.com ;; Global options: +cmd ;; Got Answer: ;; ->>header<<-opcode:query, Status:noerror, id:13748 ;; Flags:qr Rd RA; Query:1, Answer:3, authority:0, additional:0
;; QUESTION section: ; www.baidu.com. In A
;; ANSWER section: www.baidu.com. 196 in CNAME www.a.shifen.com. Www.a.shifen.com. 292 in a 220.181.112.244 Www.a.shifen.com. 292 in a 220.181.111.188
;; Query Time:7 msec ;; server:219.141.140.10#53 (219.141.140.10) ;; When: 512 months 10:00:52 CST 2016 ;; MSG SIZE rcvd:90 |
query a record of JD.com
[Email protected] ~]# dig JD.com A +noall +answer |
querying MX records for JD.com
[Email protected] ~]# dig JD.com MX +noall +answer |
querying authoritative DNS for JD.com
[Email protected] ~]# dig JD.com NS +noall +answer |
view a short reply
[Email protected] ~]# dig JD.com +short |
Learn from:
Http://www.cnblogs.com/daxian2012/archive/2013/01/10/2854126.html
This article is from the "Zhao Dongwei blog" blog, make sure to keep this source http://zhaodongwei.blog.51cto.com/4233742/1881056
Linux command (PNS): Dig command-domain search tool