World Library  
Flag as Inappropriate
Email this Article

Dig (command)

Article Id: WHEBN0007724754
Reproduction Date:

Title: Dig (command)  
Author: World Heritage Encyclopedia
Language: English
Subject: Nslookup, DNS software, Free network-related software, Dig (disambiguation), History (Unix)
Collection: Dns Software, Domain Name System, Free Network-Related Software
Publisher: World Heritage Encyclopedia

Dig (command)

dig (domain information groper) is a network administration command-line tool for querying Domain Name System (DNS) name servers.

dig is useful for network troubleshooting and for educational purposes. dig can operate in interactive command line mode or in batch mode by reading requests from an operating system file. When a specific name server is not specified in the command invocation, it will use the operating systems default resolver, usually configured via the resolv.conf file. Without any arguments it queries the DNS root zone.

dig supports Internationalized Domain Name (IDN) queries.

dig is part of the BIND domain name server software suite. dig replaces older tools such as nslookup and the host program.


  • Example usage 1
  • See also 2
  • References 3
  • External links 4

Example usage

In this example, dig is used to query for any type of record information in the domain

$ dig any
; <<>> DiG 9.6.1 <<>> any
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4016
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 0

;                   IN      ANY

;; ANSWER SECTION:            172719  IN      NS            172719  IN      NS            172719  IN      A            172719  IN      SOA 2007051703 7200 3600 1209600 86400

;; Query time: 1 msec
;; SERVER: ::1#53(::1)
;; WHEN: Wed Aug 12 11:40:43 2009
;; MSG SIZE  rcvd: 154

The number 172719 in the above example represents the Time to live value.

Queries may be directed to designated DNS servers for specific records; in this example, MX records:

$ dig MX
; <<>> DiG 9.6.1 <<>> MX
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61144
;; flags: qr aa rd; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 2
;; WARNING: recursion requested but not available

;                 IN      MX

;; ANSWER SECTION:          3600    IN      MX      10          3600    IN      MX      50

;; ADDITIONAL SECTION:  3600    IN      A    3600    IN      A

;; Query time: 73 msec
;; WHEN: Wed Aug 12 11:51:03 2009
;; MSG SIZE  rcvd: 109

See also


Paul Albitz and Cricket Liu. DNS and BIND, 5th Edition. Nutshell Series. O'Reilly and Associates, Inc., 2006.

External links

  •  – BIND 9
  • How to use dig to query DNS name servers
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.