diff --git a/README.md b/README.md index ddd6f59..9599d39 100644 --- a/README.md +++ b/README.md @@ -74,8 +74,8 @@ A high QPS DNS benchmark. Flags: --help Show context-sensitive help (also try --help-long and --help-man). - -s, --server="127.0.0.1" DNS server IP:port to test. IPv6 is also supported, for example '[fddd:dddd::]:53'. Also DoH servers are supported such as `https://1.1.1.1`, when such server is provided, - the benchmark automatically switches to the use of DoH. + -s, --server="127.0.0.1" DNS server IP:port to test. IPv6 is also supported, for example '[fddd:dddd::]:53'. Also DoH servers are supported such as `https://1.1.1.1/dns-query`, when such server is provided, + the benchmark automatically switches to the use of DoH. Note that path on which DoH server handles requests (like `/dns-query`) has to be provided as well. -t, --type=A Query type. -n, --number=1 Number of queries to issue. Note that the total number of queries issued = number*concurrency*len(queries). -c, --concurrency=1 Number of concurrent queries to issue. @@ -643,9 +643,9 @@ DNS distribution, 100 datapoints ### DoH ``` -$ dnstrace -n 200 -c 2 --server 'https://1.1.1.1' --recurse google.com +$ dnstrace -n 200 -c 2 --server 'https://1.1.1.1/dns-query' --recurse google.com Using 1 hostnames -Benchmarking https://1.1.1.1 via udp with 2 concurrent requests +Benchmarking https://1.1.1.1/dns-query via udp with 2 concurrent requests Total requests: 400 DNS success codes: 400 diff --git a/cmd/dnstrace/benchmark.go b/cmd/dnstrace/benchmark.go index 0bfe15d..15354c9 100644 --- a/cmd/dnstrace/benchmark.go +++ b/cmd/dnstrace/benchmark.go @@ -126,7 +126,7 @@ func do(ctx context.Context) []*rstats { start := time.Now() if useDoH { - r, err = dohClient.PostSend(ctx, *pServer, m) + r, err = dohClient.SendViaPost(ctx, *pServer, m) if err != nil { atomic.AddInt64(&ecount, 1) continue diff --git a/cmd/dnstrace/benchmark_test.go b/cmd/dnstrace/benchmark_test.go index 5bf2ac9..9128b5b 100644 --- a/cmd/dnstrace/benchmark_test.go +++ b/cmd/dnstrace/benchmark_test.go @@ -44,7 +44,7 @@ func Test_do(t *testing.T) { { "benchmark against GoogleDNS - DNS over HTTPS", args{ - server: "https://1.1.1.1", + server: "https://1.1.1.1/dns-query", }, }, } diff --git a/cmd/dnstrace/root.go b/cmd/dnstrace/root.go index 5222d22..fe4ee74 100644 --- a/cmd/dnstrace/root.go +++ b/cmd/dnstrace/root.go @@ -26,7 +26,8 @@ var ( pApp = kingpin.New("dnstrace", "A high QPS DNS benchmark.").Author(author) pServer = pApp.Flag("server", "DNS server IP:port to test. IPv6 is also supported, for example '[fddd:dddd::]:53'. "+ - "Also DoH servers are supported such as `https://1.1.1.1`, when such server is provided, the benchmark automatically switches to the use of DoH.").Short('s').Default("127.0.0.1").String() + "Also DoH servers are supported such as `https://1.1.1.1/dns-query`, when such server is provided, the benchmark automatically switches to the use of DoH. "+ + "Note that path on which DoH server handles requests (like `/dns-query`) has to be provided as well.").Short('s').Default("127.0.0.1").String() pType = pApp.Flag("type", "Query type.").Short('t').Default("A").Enum(getSupportedDNSTypes()...) pCount = pApp.Flag("number", "Number of queries to issue. Note that the total number of queries issued = number*concurrency*len(queries).").Short('n').Default("1").Int64() diff --git a/go.mod b/go.mod index ef014a8..21a6e00 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/olekukonko/tablewriter v0.0.0-20170719101040-be5337e7b39e github.com/sergi/go-diff v1.2.0 // indirect github.com/stretchr/testify v1.7.0 - github.com/tantalor93/doh-go v0.0.0-20210731214227-ba23c961efc3 + github.com/tantalor93/doh-go v0.0.0-20210801173902-bd6f877f039b // indirect go.uber.org/ratelimit v0.2.0 golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c gonum.org/v1/plot v0.9.0 diff --git a/go.sum b/go.sum index c2a1996..4a41872 100644 --- a/go.sum +++ b/go.sum @@ -80,6 +80,8 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tantalor93/doh-go v0.0.0-20210731214227-ba23c961efc3 h1:HCrWNaKP+5DfimIzGLsUnuEA5gd+oG5p/Wh0r9COMnA= github.com/tantalor93/doh-go v0.0.0-20210731214227-ba23c961efc3/go.mod h1:huQbBybJYCMipbDXgkk9qx8IBVBm1E//+PBOo8OBbmU= +github.com/tantalor93/doh-go v0.0.0-20210801173902-bd6f877f039b h1:viFiu3zx/s5CNo12TIVBM+rrI/cDqwoOz0QvAS/VyYk= +github.com/tantalor93/doh-go v0.0.0-20210801173902-bd6f877f039b/go.mod h1:huQbBybJYCMipbDXgkk9qx8IBVBm1E//+PBOo8OBbmU= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/ratelimit v0.2.0 h1:UQE2Bgi7p2B85uP5dC2bbRtig0C+OeNRnNEafLjsLPA=