pavement

Dig

From FreeBSDwiki
Jump to: navigation, search

dig is a tool for troubleshooting DNS issues. It is very similar but preferred to the now obsolete nslookup. dig is included with the BIND DNS software, which is part of the base system.

The command format is

dig [@server.you.want.to.query] [RECORDTYPE] record_you're_looking_for 

for example:

dig @192.168.1.1 A freebsdwiki.net

will query the DNS server running at 192.168.1.1 for the "A" (host) record for freebsdwiki.net. You should get results very much like:

; <<>> DiG 9.2.3 <<>> @192.168.1.1 freebsdwiki.net a
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2879
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;freebsdwiki.net.               IN      A

;; ANSWER SECTION:
freebsdwiki.net.        300     IN      A       66.154.114.98

;; Query time: 123 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Sun Dec 25 16:26:35 2005
;; MSG SIZE  rcvd: 49

options

-x reverse lookup


To learn more about DNS, see also: root servers, zone file, DNS record types

For more DNS tools, see: whois, nslookup, host, traceroute

Personal tools