How to use dig

How to use the dig command.

Type in the domain name after the dig command to dig a domain:

dig [domain]

For example:

dig example.com

The result is:

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

The dig command uses the following syntax:

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

As shown in the syntax above, you can insert up to 5 parameters:

  • [domain]
  • [q-type]
  • [q-class]
  • [q-opt]
  • [global-d-opt]

Please see the Referencespage for a detailed list of options.