Ubuntu/Commands/dig
From r00tedvw.com wiki
(Difference between revisions)
Line 12: | Line 12: | ||
==Examples== | ==Examples== | ||
+ | <nowiki> | ||
+ | $ dig -t a r00tedvw.com | ||
+ | |||
+ | ; <<>> DiG 9.8.3-P1 <<>> -t a r00tedvw.com | ||
+ | ;; global options: +cmd | ||
+ | ;; Got answer: | ||
+ | ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47382 | ||
+ | ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0 | ||
+ | |||
+ | ;; QUESTION SECTION: | ||
+ | ;r00tedvw.com. IN A | ||
+ | |||
+ | ;; AUTHORITY SECTION: | ||
+ | r00tedvw.com. 900 IN SOA ns21.domaincontrol.com. dns.jomax.net. 2013052201 28800 7200 604800 3600 | ||
+ | |||
+ | ;; Query time: 106 msec | ||
+ | ;; SERVER: 10.45.57.101#53(10.45.57.101) | ||
+ | ;; WHEN: Sun Apr 12 18:56:24 2015 | ||
+ | ;; MSG SIZE rcvd: 98</nowiki> | ||
+ | |||
+ | <nowiki> | ||
+ | $ dig -t mx earthlink.net | ||
+ | |||
+ | ; <<>> DiG 9.8.3-P1 <<>> -t mx earthlink.net | ||
+ | ;; global options: +cmd | ||
+ | ;; Got answer: | ||
+ | ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18890 | ||
+ | ;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 4 | ||
+ | |||
+ | ;; QUESTION SECTION: | ||
+ | ;earthlink.net. IN MX | ||
+ | |||
+ | ;; ANSWER SECTION: | ||
+ | earthlink.net. 1768 IN MX 5 mx1.earthlink.net. | ||
+ | earthlink.net. 1768 IN MX 5 mx2.earthlink.net. | ||
+ | earthlink.net. 1768 IN MX 5 mx3.earthlink.net. | ||
+ | earthlink.net. 1768 IN MX 5 mx4.earthlink.net. | ||
+ | |||
+ | ;; ADDITIONAL SECTION: | ||
+ | mx1.earthlink.net. 1564 IN A 209.86.93.226 | ||
+ | mx2.earthlink.net. 1564 IN A 209.86.93.227 | ||
+ | mx3.earthlink.net. 1564 IN A 209.86.93.228 | ||
+ | mx4.earthlink.net. 1564 IN A 209.86.93.229 | ||
+ | |||
+ | ;; Query time: 62 msec | ||
+ | ;; SERVER: 10.45.57.101#53(10.45.57.101) | ||
+ | ;; WHEN: Sun Apr 12 18:57:22 2015 | ||
+ | ;; MSG SIZE rcvd: 175</nowiki> |
Revision as of 18:57, 12 April 2015
Commands | dig
dig
dig (domain information groper) is a network administration command-line tool for querying Domain Name System (DNS) name servers.©
Command Syntax
dig [@server] [-t type] [-x addr]
- [@server]
- allows you to query a specific DNS server
- [-t type]
- allows you to query a specific type of DNS record, A,MX,PTR,CNAME,SOA,SRV,etc
- [-x addr] or [-x]
- performs a reverse lookup, matching address to name. The name has to be registered with .arpa in order for this to work.
Examples
$ dig -t a r00tedvw.com ; <<>> DiG 9.8.3-P1 <<>> -t a r00tedvw.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47382 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0 ;; QUESTION SECTION: ;r00tedvw.com. IN A ;; AUTHORITY SECTION: r00tedvw.com. 900 IN SOA ns21.domaincontrol.com. dns.jomax.net. 2013052201 28800 7200 604800 3600 ;; Query time: 106 msec ;; SERVER: 10.45.57.101#53(10.45.57.101) ;; WHEN: Sun Apr 12 18:56:24 2015 ;; MSG SIZE rcvd: 98
$ dig -t mx earthlink.net ; <<>> DiG 9.8.3-P1 <<>> -t mx earthlink.net ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18890 ;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 4 ;; QUESTION SECTION: ;earthlink.net. IN MX ;; ANSWER SECTION: earthlink.net. 1768 IN MX 5 mx1.earthlink.net. earthlink.net. 1768 IN MX 5 mx2.earthlink.net. earthlink.net. 1768 IN MX 5 mx3.earthlink.net. earthlink.net. 1768 IN MX 5 mx4.earthlink.net. ;; ADDITIONAL SECTION: mx1.earthlink.net. 1564 IN A 209.86.93.226 mx2.earthlink.net. 1564 IN A 209.86.93.227 mx3.earthlink.net. 1564 IN A 209.86.93.228 mx4.earthlink.net. 1564 IN A 209.86.93.229 ;; Query time: 62 msec ;; SERVER: 10.45.57.101#53(10.45.57.101) ;; WHEN: Sun Apr 12 18:57:22 2015 ;; MSG SIZE rcvd: 175