libpcap-based Tool for Analyzing DNS Performance
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


libpcap-based tool for analyzing DNS performance

Build Status

Copyright 2017 by Alexander Koch


dnsstat was created in desperate need for having a tool to debug DNS problems on a home-broadband connection. Surfing the web felt slow and stuttery, but issuing test-queries using dig never yielded any lost query, so I decided to capture all DNS traffic and do offline analysis.

Fiddling around with Wireshark traces then felt just wrong at some point. Never do analysis on large datasets by hand that a machine can do much better for you instead.


Make sure you have the following requirements installed:

  • libpcap (tested with 1.8.1)

The code is supplied as a CMake project so either use your favorite IDE or compile manually (example builds inside source tree):

$ cmake .
$ make

There currently is no installation mechanism, the binary is located in the build directory.


Just run the binary with a pcap file as argument:

$ ./dnsstat /path/to/trace.pcap
    sent:           309
    answered:       307
    lost:             2 (0.01%)
    min:           0.11 ms
    avg:          66.89 ms
    max:        1052.54 ms
    stdev:       206.59 ms

Help is available using -h.


I provide this as-is, in hope that it might be of any use for someone who needs to debug DNS problems or collect DNS performance metrics.

Pull requests for improvements or bug fixes are always welcome.


This work is published under the terms of the MIT License, see file LICENSE.