You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: check-dns/README.md
+41-21Lines changed: 41 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,45 @@
4
4
5
5
Monitor DNS response.
6
6
7
-
## Synopsis
7
+
## Usage
8
+
9
+
### Options
10
+
8
11
```
9
-
check-dns -H example.com -s 8.8.8.8
12
+
-H, --host= The name or address you want to query
13
+
-s, --server= DNS server you want to use for the lookup
14
+
-p, --port= Port number you want to use (default: 53)
15
+
-q, --querytype= DNS record query type (default: A)
16
+
--norec Set not recursive mode
17
+
-e, --expected-string= IP-ADDRESS string you expect the DNS server to return. If multiple IP-ADDRESS are returned at once, you have to specify whole string
18
+
```
19
+
20
+
- query class is always IN.
21
+
- Punycode is not supported.
22
+
23
+
### Check DNS server status
24
+
25
+
If DNS server returns `NOERROR` in status of HEADER, then the checker result becomes `OK`, if not `NOERROR`, then `CRITICAL`
26
+
27
+
```
28
+
check-dns -H a.root-servers.net -s 8.8.8.8
29
+
```
30
+
31
+
### Check string DNS server returns
32
+
33
+
- The currently supported query types are A, AAAA.
Copy file name to clipboardExpand all lines: check-dns/lib/check_dns.go
+57-12Lines changed: 57 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -13,12 +13,12 @@ import (
13
13
)
14
14
15
15
typednsOptsstruct {
16
-
Hoststring`short:"H" long:"host" required:"true" description:"The name or address you want to query"`
17
-
Serverstring`short:"s" long:"server" description:"DNS server you want to use for the lookup"`
18
-
Portint`short:"p" long:"port" default:"53" description:"Port number you want to use"`
19
-
QueryTypestring`short:"q" long:"querytype" default:"A" description:"DNS record query type where TYPE =(A, AAAA, SRV, TXT, MX, ANY)"`
20
-
QueryClassstring`short:"c" long:"queryclass" default:"IN" description:"DNS record class type where TYPE =(IN, CS, CH, HS, NONE, ANY)"`
21
-
Norecbool`long:"norec" description:"Set not recursive mode"`
16
+
Hoststring`short:"H" long:"host" required:"true" description:"The name or address you want to query"`
17
+
Serverstring`short:"s" long:"server" description:"DNS server you want to use for the lookup"`
18
+
Portint`short:"p" long:"port" default:"53" description:"Port number you want to use"`
19
+
QueryTypestring`short:"q" long:"querytype" default:"A" description:"DNS record query type"`
20
+
Norecbool`long:"norec" description:"Set not recursive mode"`
21
+
ExpectedString []string`short:"e" long:"expected-string" description:"IP-ADDRESS string you expect the DNS server to return. If multiple IP-ADDRESS are returned at once, you have to specify whole string"`
0 commit comments