ding is a command-line utility for measuring DNS lookup latency against a
specific DNS server, similar in spirit to ping.
Instead of sending ICMP packets, ding repeatedly performs DNS lookups using
the DNS server provided as an argument and reports response times, packet loss,
and round-trip-time statistics.
Clone the repository:
git clone https://github.com/splitnines/ding.git
cd dingBuild ding from source:
makeThis creates the executable at:
build/dingYou can run it directly:
./build/ding 1.1.1.1To install it system-wide:
sudo make installBy default, this installs ding to /usr/local/bin.
To install it somewhere else, override PREFIX:
make install PREFIX="$HOME/.local"Make sure the install location is in your PATH:
export PATH="$HOME/.local/bin:$PATH"To remove build artifacts:
make cleanding <dns server> [options]Options:
-n, --name <hostname> host name to look up (default: google.com)
-c, --count <count> stop after <count> replies
-t, --timeout <timeout> time, in seconds, to wait for a response
-i, --interval <interval> time, in seconds, between requests
-q, --quiet quiet output
-s, --save [path/to/file] save summary to file
-h, --help print help and exit
-V, --version print version and exit
Query Cloudflare DNS five times:
ding 1.1.1.1 -c5Look up a custom hostname using Google DNS:
ding 8.8.8.8 -n example.comUse a custom interval and timeout:
ding 1.1.1.1 -i0.025 -t0.025Run five queries and save the summary to a file:
ding 8.8.8.8 -c5 -s results.csvDNS server: 1.1.1.1 (one.one.one.one) DNS lookup: google.com
response from 1.1.1.1: name=google.com sequence=1 time=14.680 ms
response from 1.1.1.1: name=google.com sequence=2 time=15.568 ms
response from 1.1.1.1: name=google.com sequence=3 time=14.845 ms
response from 1.1.1.1: name=google.com sequence=4 time=16.401 ms
response from 1.1.1.1: name=google.com sequence=5 time=15.565 ms
--- 1.1.1.1 ding statistics ---
5 packets transmitted, 5 received, 0.00% packet loss, time 77ms
rtt min/avg/max/mdev 14.680/15.412/16.401/0.614 ms
sequence: the request numbertime: DNS lookup response time in millisecondspacket loss: percentage of DNS requests that did not receive a responsertt min/avg/max/mdev: minimum, average, maximum, and mean deviation of response times
ding has currently only been built and tested on Linux.
Other Unix-like systems may work, but they are not officially supported yet. Windows is not currently supported.