dig

dig is a command-line tool for inspecting DNS.

dig ( Domain Information Groper) is a command-line tool for inspecting the Domain Name System (DNS).

The dig command is used mainly for network troubleshooting. This command can be used on Linux, MacOS and Windows systems.

The dig command uses the following syntax:

dig [domain] [q-type]    [q-class]   {q-opt} {global-d-opt}

Example of dig commands and results

Here is an example of running dig example.com on Windows systems:

Microsoft Windows [Version 10.0.19044.2130]
(c) Microsoft Corporation. All rights reserved.

C: \Users\asus>dig example.com

; <<>> DiG 9.16.33 <<>> example.com
;; global options: +md
;; Got answer:
;; ->>HEADERくく- opcode: QUERY, status: NOERROR, id: 62896
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; up: 1232
;; QUESTION SECTION:
;example.com.               IN              A

;; ANSWER SECTION:
example.com.    64503       IN              93.184.216.34

;; Query time: 225 msec
;; SERVER: 10.99.0.1#53(10.99.0.1)
;; WHEN: Sun Oct 23 12:05:08 SE Asia Standard Time 2022
;; MSG SIZE revd: 56

Example of dig command on Windows

Here is another example of running dig google.com any on Windows systems:

C: \Users \asus>dig google.com any

; <<>> DiG 9.16.33 <<>> google.com any
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27078
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;google.com.            IN  ANY

;; ANSWER SECTION:
google.com.     1995    IN  A   142.250.189.14
google.com.     1495    IN  SOA ns1.google.com. dns-admin.google.com. 483002479 900 900 1800 60
google.com.     50236   IN  NS  ns1.google.com.
google.com.     50236   IN  NS  ns2.google.com.
google.com.     50236   IN  NS  ns3.google.com.
google.com.     50236   IN  NS  ns4.google.com.

;; Query time: 187 msec
;; SERVER: 10.99.0.1#53(10.99.0.1)
;; WHEN: Sun Oct 23 12:06:27 SE Asia Standard Time 2022
;; MSG SIZE revd: 173

Dig google domain command on Windows