Skip to content

Commit 4410a25

Browse files
committed
cmd/dnsr: add -t to expose WithTCPRetry option
1 parent d18731d commit 4410a25

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cmd/dnsr/main.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,13 @@ import (
1414

1515
var (
1616
verbose bool
17-
resolver = dnsr.New(10000)
17+
tcpRetry bool
18+
resolver = dnsr.NewResolver(dnsr.WithCache(1000))
1819
)
1920

2021
func init() {
21-
flag.BoolVar(
22-
&verbose,
23-
"v",
24-
false,
25-
"print verbose info to the console",
26-
)
22+
flag.BoolVar(&verbose, "v", false, "print verbose info to the console")
23+
flag.BoolVar(&tcpRetry, "t", false, "enable TCP retry")
2724
}
2825

2926
func logV(fmt string, args ...interface{}) {
@@ -47,6 +44,9 @@ func main() {
4744
} else if _, isType := dns.StringToType[args[len(args)-1]]; len(args) > 1 && isType {
4845
qtype, args = args[len(args)-1], args[:len(args)-1]
4946
}
47+
if tcpRetry {
48+
resolver = dnsr.NewResolver(dnsr.WithTCPRetry())
49+
}
5050
if verbose {
5151
dnsr.DebugLogger = os.Stderr
5252
}

0 commit comments

Comments
 (0)