handbook:handbook:tools_dig:dig
Dig
The dig utility by Steve Hotz and Paul Mockapetris. This is a command-line tool for querying Domain Name System servers. It is much easier to use than nslookup, and is well-suited for use within shell scripts.
DIG Download mirror : ftp://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/dig/
Examples of Dig Query
1) Request A Record
[root@darkstar ~]# dig linux.edu in a
; <<>> DiG 9.3.1 <<>> linux.edu in a ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11301 ;; flags: qr; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;linux.edu. IN A ;; ANSWER SECTION: linux.edu. 604250 IN A 208.176.116.21 ;; Query time: 39 msec ;; SERVER: 212.27.53.252#53(212.27.53.252) ;; WHEN: Sun Apr 2 12:39:17 2006 ;; MSG SIZE rcvd: 43 [root@darkstar ~]#
2) Request NS Record
[root@darkstar ~]# dig linux.edu in NS ; <<>> DiG 9.3.1 <<>> linux.edu in NS ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23121 ;; flags: qr; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;linux.edu. IN NS ;; ANSWER SECTION: linux.edu. 604800 IN NS ns2.signal1network.com. linux.edu. 604800 IN NS ns1.signal1network.com. linux.edu. 604800 IN NS master.linux.edu. ;; Query time: 1138 msec ;; SERVER: 212.27.54.252#53(212.27.54.252) ;; WHEN: Sun Apr 2 12:40:29 2006 ;; MSG SIZE rcvd: 102 [root@darkstar ~]#
3) Request SOA Record
[root@darkstar ~]# dig linux.edu in SOA ; <<>> DiG 9.3.1 <<>> linux.edu in SOA ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4849 ;; flags: qr; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;linux.edu. IN SOA ;; ANSWER SECTION: linux.edu. 604800 IN SOA ns1.signal1network.com. eduard.linuxlabs.com. 2006040100 86400 7200 2592000 7200 ;; Query time: 1139 msec ;; SERVER: 212.27.54.252#53(212.27.54.252) ;; WHEN: Sun Apr 2 12:40:55 2006 ;; MSG SIZE rcvd: 102 [root@darkstar ~]#
Documentation Advanced DNS documentation can be find in the DNS-HOWTO document.
handbook/handbook/tools_dig/dig.txt · Last modified: by 127.0.0.1
