File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,8 @@ func setupFlags() *flag.FlagSet {
120
120
f .String ("tls-hostname" , "" , "Hostname for certificate verification" )
121
121
f .Bool ("skip-hostname-verification" , false , "Skip TLS Hostname Verification" )
122
122
123
+ f .Bool ("any" , false , "Query all supported DNS record types" )
124
+
123
125
f .BoolP ("json" , "J" , false , "Set the output format as JSON" )
124
126
f .Bool ("short" , false , "Short output format" )
125
127
f .Bool ("time" , false , "Display how long the response took" )
Original file line number Diff line number Diff line change @@ -5,13 +5,16 @@ import (
5
5
"strings"
6
6
7
7
"github.com/miekg/dns"
8
+ "github.com/mr-karan/doggo/pkg/models"
8
9
)
9
10
10
11
// LoadFallbacks sets fallbacks for options
11
12
// that are not specified by the user but necessary
12
13
// for the resolver.
13
14
func (app * App ) LoadFallbacks () {
14
- if len (app .QueryFlags .QTypes ) == 0 {
15
+ if app .QueryFlags .QueryAny {
16
+ app .QueryFlags .QTypes = models .GetCommonRecordTypes ()
17
+ } else if len (app .QueryFlags .QTypes ) == 0 {
15
18
app .QueryFlags .QTypes = append (app .QueryFlags .QTypes , "A" )
16
19
}
17
20
if len (app .QueryFlags .QClasses ) == 0 {
Original file line number Diff line number Diff line change 1
1
package models
2
2
3
- import "time"
3
+ import (
4
+ "strings"
5
+ "time"
6
+ )
4
7
5
8
const (
6
9
// DefaultTLSPort specifies the default port for a DNS server connecting over TCP over TLS.
@@ -39,6 +42,7 @@ type QueryFlags struct {
39
42
Strategy string `koanf:"strategy" strategy:"-"`
40
43
InsecureSkipVerify bool `koanf:"skip-hostname-verification" skip-hostname-verification:"-"`
41
44
TLSHostname string `koanf:"tls-hostname" tls-hostname:"-"`
45
+ QueryAny bool `koanf:"any" json:"any"`
42
46
}
43
47
44
48
// Nameserver represents the type of Nameserver
@@ -47,3 +51,11 @@ type Nameserver struct {
47
51
Address string
48
52
Type string
49
53
}
54
+
55
+ // CommonRecordTypes is a string containing all common DNS record types
56
+ const CommonRecordTypes = "A AAAA CNAME MX NS PTR SOA SRV TXT CAA"
57
+
58
+ // GetCommonRecordTypes returns a slice of common DNS record types
59
+ func GetCommonRecordTypes () []string {
60
+ return strings .Fields (CommonRecordTypes )
61
+ }
You can’t perform that action at this time.
0 commit comments