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
+7-46Lines changed: 7 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,25 +12,26 @@ Monitor DNS response.
12
12
-H, --host= The name or address you want to query
13
13
-s, --server= DNS server you want to use for the lookup
14
14
-p, --port= Port number you want to use (default: 53)
15
-
-q, --querytype= DNS record query type where TYPE =(A, AAAA, TXT, MX, CNAME) (default: A)
16
-
-c, --queryclass= DNS record class type where TYPE =(IN, CS, CH, HS, NONE, ANY) (default: IN)
15
+
-q, --querytype= DNS record query type (default: A)
16
+
-c, --queryclass= DNS record class type (default: IN)
17
17
--norec Set not recursive mode
18
-
-e, --expected-string= The string you expect the DNS server to return. If multiple responses are returned at once, you have to specify whole string
18
+
-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
19
19
```
20
20
21
-
- The currently supported query types are A, AAAA, TXT, MX, CNAME.
22
21
- Punycode is not supported.
23
22
24
23
### Check DNS server status
25
24
26
25
If DNS server returns `NOERROR` in status of HEADER, then the checker result becomes `OK`, if not `NOERROR`, then `CRITICAL`
27
26
28
27
```
29
-
check-dns -H example.com -s 8.8.8.8
28
+
check-dns -H a.root-servers.net -s 8.8.8.8
30
29
```
31
30
32
31
### Check string DNS server returns
33
32
33
+
- The currently supported query types are A, AAAA.
34
+
34
35
If DNS server returns 1.1.1.1 and 2.2.2.2
35
36
```
36
37
-a 1.1.1.1 -a 2.2.2.2 -> OK
@@ -41,7 +42,7 @@ If DNS server returns 1.1.1.1 and 2.2.2.2
41
42
-a 3.3.3.3 -a 4.4.4.4 -a 5.5.5.5 -> CRITICAL
42
43
```
43
44
```
44
-
check-dns -H example.com -s 8.8.8.8 -a 93.184.216.34
Copy file name to clipboardExpand all lines: check-dns/lib/check_dns.go
+10-16Lines changed: 10 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -16,14 +16,12 @@ type dnsOpts struct {
16
16
Hoststring`short:"H" long:"host" required:"true" description:"The name or address you want to query"`
17
17
Serverstring`short:"s" long:"server" description:"DNS server you want to use for the lookup"`
18
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, TXT, MX, CNAME)"`
20
-
QueryClassstring`short:"c" long:"queryclass" default:"IN" description:"DNS record class type where TYPE =(IN, CS, CH, HS, NONE, ANY)"`
19
+
QueryTypestring`short:"q" long:"querytype" default:"A" description:"DNS record query type"`
20
+
QueryClassstring`short:"c" long:"queryclass" default:"IN" description:"DNS record class type"`
21
21
Norecbool`long:"norec" description:"Set not recursive mode"`
22
-
ExpectedString []string`short:"e" long:"expected-string" description:"The string you expect the DNS server to return. If multiple responses are returned at once, you have to specify whole string"`
22
+
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