Skip to content

Commit 230b8c8

Browse files
committed
Add options to the dig article
1 parent 0cff8f4 commit 230b8c8

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

content/articles/dns/dig.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ The output format is similar to a [zone file](zone-files.md), where lines starti
7676

7777
* **Dig version:** For example, `9.18.30-0ubuntu0.24.04.2-Ubuntu`.
7878
* **Command:** The domain you queried, here `example.com`.
79-
* **Global options:** Any extra flags you passed (e.g., `+trace`).
79+
* **Global options:** Any [extra flags](#options) you passed (e.g., `+trace`).
8080

8181
### 2. Header
8282

@@ -135,3 +135,43 @@ Each section lists its [resource records](resource-records.md) in a readable for
135135
* **SERVER:** The DNS server that replied, including port (`#53`) and protocol (`UDP`).
136136
* **WHEN:** Date and time of the query.
137137
* **MSG SIZE rcvd:** Size of the reply in bytes.
138+
139+
## Useful Options {#options}
140+
141+
There are a few useful options:
142+
143+
* `+short` - only prints the IP address:
144+
145+
```sh
146+
$ dig wikipedia.org +short
147+
185.15.59.224
148+
```
149+
150+
* `+trace` - show exactly how responded with what:
151+
152+
```sh
153+
$ dig wikipedia.org +trace
154+
155+
; <<>> DiG 9.18.33-1~deb12u2-Raspbian <<>> wikipedia.org +trace
156+
;; global options: +cmd
157+
. 41959 IN NS m.root-servers.net.
158+
. 41959 IN NS d.root-servers.net.
159+
. 41959 IN NS f.root-servers.net.
160+
...
161+
;; Received 1097 bytes from 192.168.0.1#53(192.168.0.1) in 20 ms
162+
163+
org. 172800 IN NS d0.org.afilias-nst.org.
164+
org. 172800 IN NS b0.org.afilias-nst.org.
165+
org. 172800 IN NS b2.org.afilias-nst.org.
166+
...
167+
;; Received 782 bytes from 2001:dc3::35#53(m.root-servers.net) in 50 ms
168+
169+
wikipedia.org. 3600 IN NS ns0.wikimedia.org.
170+
wikipedia.org. 3600 IN NS ns1.wikimedia.org.
171+
wikipedia.org. 3600 IN NS ns2.wikimedia.org.
172+
...
173+
;; Received 655 bytes from 2001:500:48::1#53(b2.org.afilias-nst.org) in 30 ms
174+
175+
wikipedia.org. 180 IN A 185.15.59.224
176+
;; Received 78 bytes from 208.80.154.238#53(ns0.wikimedia.org) in 140 ms
177+
```

0 commit comments

Comments
 (0)