dnsbench

package module
v0.0.0-...-25470ef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2018 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 get -u github.com/askcom/dnsbench/cmd/dnsbench

Usage and examples

dnsbench <nameserver> [flags]
  -concurrency int
        Numer of concurrent requests (default 10)
  -count int
        Number of requests to make (default 1000)
  -interval duration
        Reporting interval (default 5s)
  -local
        Use local resolver
  -names string
        File containing names to request (default "-")
  -qps int
        QPS to attempt for each worker (0 for no limit)

Example 1: Benchmark DNS using local resolver:

$ echo "example.com" | dnsbench -local

Reading names from /dev/stdin
Benchmarking...

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

Finished 1000 requests

# latency summary
   1000       0   2.21    [6.31 24.12 36.80 72.35] 72.35  639.33

Concurrency level: 10
Time taken for tests: 1.56 seconds
Completed Requests: 1000
Failed Requests: 0
Requests per second: 639.33 [#/sec] (mean)
Time per request: 8.23 [ms] (mean)
Fastest request: 2.21 [ms]
Slowest request: 72.35 [ms]

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

dnsbench <nameserver ip> -names "domains_to_lookup.txt"

Reading names from domains_to_lookup.txt
Benchmarking...

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisplayReport

func DisplayReport(hist *hdrhistogram.Histogram, errors int64, dur float64)

DisplayReport prints a HDR histogram summary of a DNS benchmark run

func LocalResolve

func LocalResolve(names []string, count int, qps int, results chan<- *Result)

LocalResolve does DNS lookups using the local resolver

func ReadNames

func ReadNames(path string) ([]string, error)

ReadNames reads domain names from a given file and returns them in a slice

func Resolve

func Resolve(nameserver string, names []string, count int, qps int, results chan<- *Result)

Resolve does DNS lookups using specified nameserver

Types

type Result

type Result struct {
	Duration time.Duration
	Error    bool
}

Result holds the result of an individual dns lookup

type Stats

type Stats struct {
	Errors    int64
	Hist      *hdrhistogram.Histogram
	IntErrors int64
	IntHist   *hdrhistogram.Histogram
}

Stats holds a summary of DNS benchmark results

Directories

Path Synopsis
cmd
dnsbench command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址