Skip to content

Commit 38b4228

Browse files
committed
add default:// resolver scheme
1 parent 660d433 commit 38b4228

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ func parse_args() CLIArgs {
362362
flag.Int64Var(&args.bwBurst, "bw-limit-burst", 0, "allowed burst size for bandwidth limit, how many \"tokens\" can fit into leaky bucket")
363363
flag.UintVar(&args.bwBuckets, "bw-limit-buckets", 1024*1024, "number of buckets of bandwidth limit")
364364
flag.BoolVar(&args.bwSeparate, "bw-limit-separate", false, "separate upload and download bandwidth limits")
365-
flag.Func("nameserver", "nameserver specification (udp://..., tcp://..., https://..., tls://..., doh://..., dot://...). Option can be used multiple times for parallel use of multiple nameservers. Empty string resets list", func(p string) error {
365+
flag.Func("dns-server", "nameserver specification (udp://..., tcp://..., https://..., tls://..., doh://..., dot://..., default://). Option can be used multiple times for parallel use of multiple nameservers. Empty string resets list", func(p string) error {
366366
if p == "" {
367367
args.nameservers = nil
368368
} else {

resolver/factory.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ begin:
5555
}
5656
hp := net.JoinHostPort(host, port)
5757
return dns.NewDoTResolver(hp, dns.DoTAddresses(hp))
58+
case "default":
59+
return net.DefaultResolver, nil
5860
default:
5961
return nil, errors.New("not implemented")
6062
}

0 commit comments

Comments
 (0)