MCPcopy Index your code
hub / github.com/askmediagroup/dnsbench

github.com/askmediagroup/dnsbench @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
55 symbols 199 edges 13 files 18 documented · 33%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

DNSBench

A simple DNS server benchmarking tool.

Have you ever needed to troubleshoot a DNS server? Or maybe you want to do some benchmarking before trouble arises. DNSBench is a simple command-line tool that can help you with that.

Installation

With Go installed:

go install github.com/askmediagroup/dnsbench/cmd/dnsbench@latest

Usage and examples

Execute a DNS benchmark test.

Usage:
  dnsbench run [command] [flags]

Flags:
  -c, --count int           Number of queries to attempt. [0 = run until interrupted] (default 100)
  -h, --help                help for run
  -i, --interval duration   Reporting interval. (default 5s)
  -m, --max-workers int     Maximum number of workers to spawn. (default 10)
  -f, --names string        Read query names from this file. (default "-")
  -n, --nameserver string   Nameserver to benchmark. (default "8.8.8.8:53")
  -q, --qps int             QPS target for the test run. [0 = No limit]
  -r, --resolver string     Resolver mode. [remote,local] (default "remote")
  -w, --workers int         Initial worker count. (default 1)

Example 1: Benchmark DNS using local resolver:

$ echo "example.com" | dnsbench run --resolver=local --count=10
Reading names from /dev/stdin
Benchmarking...

# requests errors min  [ p50  p95  p99  p999] max  qps

Finished 10 requests

# latency summary
     10       0   0.52    [0.68 8.49 8.49  8.49] 8.49  606.69

Concurrency level: 1
Time taken for tests: 0.02 seconds
Completed Requests: 10
Failed Requests: 0
Requests per second: 606.69 [#/sec] (mean)
Time per request: 1.64 [ms] (mean)
Fastest request: 0.52 [ms]
Slowest request: 8.49 [ms]

Example 2: Benchmark a specified nameserver with a file of domains:

dnsbench run --nameserver=8.8.8.8 --names "domains_to_lookup.txt"

with domains listed on individual lines of domains_to_lookup.txt, such as:

example.com
google.com
foobar.com

Status

DNSBench is currently under active development with upcoming improvements targetting:

  • Documentation
  • Command-line useability
  • Decoupling command-line and DNS lookup logic of source
  • Testing

Extension points exported contracts — how you extend this code

Resolver (Interface)
(no doc) [2 implementers]
pkg/resolver.go
Namer (FuncType)
(no doc)
pkg/namer.go

Core symbols most depended-on inside this repo

FileNamer
called by 9
pkg/namer.go
NewRemoteResolver
called by 8
pkg/resolver.go
Nameserver
called by 7
pkg/resolver.go
NewRunner
called by 6
pkg/runner.go
Start
called by 5
pkg/runner.go
Stop
called by 5
pkg/runner.go
Begin
called by 5
pkg/runner.go
MaxWorkers
called by 3
pkg/runner.go

Shape

Function 30
Method 15
Struct 8
FuncType 1
Interface 1

Languages

Go100%

Modules by API surface

pkg/runner.go10 symbols
pkg/resolver.go10 symbols
pkg/report.go8 symbols
pkg/runner_test.go6 symbols
pkg/resolver_test.go5 symbols
pkg/shared_test.go3 symbols
pkg/namer.go3 symbols
pkg/cmd/run.go3 symbols
pkg/namer_test.go2 symbols
pkg/cmd/version.go2 symbols
pkg/result.go1 symbols
pkg/cmd/root.go1 symbols

For agents

$ claude mcp add dnsbench \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact