dnstcpbench (1) - Linux Manuals

dnstcpbench: tool to perform TCP benchmarking of nameservers


dnstcpbench - tool to perform TCP benchmarking of nameservers


dnstcpbench [--help] [--file=filename] [--verbose] [--udp-first, -u] [--workers] [--timeout-msec] remote-ip-address [remote-port]


dnstcpbench reads DNS queries (by default from standard input) and sends them out in parallel to a remote nameserver. By default TCP/IP is used, but optionally, UDP is tried first, which allows for the benchmarking of TCP/IP fallback.

The input format is one query per line: qname single-space qtype. An example: www.powerdns.com ANY powerdns.com MX

When benchmarking extended runs, it may be necessary to enable TIME_WAIT recycling, as TCP/IP port tuples may otherwise run out. On Linux this is performed by running:

# echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle

The equivalent for IPv6 is not known.



Filename from which to read queries. Defaults to standard input if unspecified.


Provide a helpful message


Number of milliseconds to wait for an answer

--udp-first, -u

Attempt resolution via UDP first, only do TCP if truncated answer is received


Be wordy on what the program is doing


Number of parallel worker threads to use.

Remote IP address can be IPv4 or IPv6. Remote port defaults to 53.


The program reports both mean and median numbers for queries per second and UDP and TCP latency. Each query only counts once, even if it is tried over UDP first. This effectively means that passing -u can lower query rates if many queries get shunted to TCP.


Currently the timeout code does not actually perform non-blocking connects or writes. So a slow connect or slow writes will still cause low performance and delays.

Median queries per second statistics are reported as 0 for sub-second runs.


Written by PowerDNS.COM BV, bert hubert, <m[blue]bert.hubert [at] netherlabs.nlm[][1]>


Website: m[blue]http://www.powerdns.comm[]


Copyright © 2013 PowerDNS.COM BV. Free use of this software is granted under the terms of the GNU General Public License (GPL) version 2.


bert.hubert [at] netherlabs.nl
mailto:bert.hubert [at] netherlabs.nl