Skip to content

Commit

Permalink
Merge pull request #29 from Tantalor93/doh2
Browse files Browse the repository at this point in the history
use new version of DoH library
  • Loading branch information
Tantalor93 committed Aug 1, 2021
2 parents 1165ed4 + 03b37cc commit bef6669
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/dnstrace/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/dnstrace/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
},
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/dnstrace/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down

0 comments on commit bef6669

Please sign in to comment.