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 [] [RECORDTYPE] record_you're_looking_for 

for example:

dig @ A

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

; <<>> DiG 9.2.3 <<>> @ 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

;               IN      A

;; ANSWER SECTION:        300     IN      A

;; Query time: 123 msec
;; WHEN: Sun Dec 25 16:26:35 2005
;; MSG SIZE  rcvd: 49


-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