/dnspingtest_rrd

Monitoring of average response times of DNS resolvers in RRD databases and simple HTML pages with PNG graphs

Primary LanguageShell

This project is suitable for: Linux + macOS and has been made-with-bash + Vim +❤️

DNS-Ping Monitoring

This project implement a nice monitoring of average response times of DNS resolvers based on dnsping in RRD databases and simple HTML pages with PNG graphs. With these information you can decide which DNS resolver to choose for performance reasons.

image (45.90.30.39 NextDNS.io Monthly Response Times & Loss Stats(5min average))

vs.

image (9.9.9.11 Quad9 Monthly Response Times & Loss Stats(5min average))

vs.
image (192.168.0.13 Pi-hole Monthly Response Times & Loss Stats(5min average))

There are the following scripts that are doing the following:

01_dnsping.sh with optional parameters: random or example.com
02_dnsping-graph.sh

01_dnsping.sh

Run this script periodically (for example every 5 minutes) via crontab to performance-test some DNS resolvers. All results are written into RRD database(s).
You may use random domains or specify a domain to be queried if you don't want to use the default (heise.de).
rrd-database-files will be created if missing.

02_dnsping-graph.sh

Run this script periodically (for example every hour) via crontab to create PNG-chart(s) from results RRD database(s) for hourly/daily/weekly/monthly/yearly charts. html-files will be copied from "template". Please edit them for your purpose.

dnsresolvers.list

🚧 You have to check and edit this file!

Crontab

# this is my dnsping:
*/5 * * * * ~/dev/dnspingtest_rrd/01_dnsping.sh >/dev/null
0   * * * * ~/dev/dnspingtest_rrd/02_dnsping-graph.sh >/dev/null

Examples

I've uploaded some real-world examples from my home-network (Vodafone Gigabit wth 1000 downlink and 50 Mbit uplink with a static domain and with random domains for every DNS resolver, and some Hetzner-Cloudserver in Nuremberg/Germany, Falkenstein/Germany and Helsinki/Finland) monitored via Wifi which is how most devices/gadgets nowadays are connected and what query times they will experience, too. This is much more realistic for home- and end-users than monitoring via a direct connection to DE-CIX. Please watch out for the index-html files.

Alternatives

If you are more cloud-savvy, you could do this also with Netdata and these docs/links:

Which gives you this for example:

image

image

image

image

Have fun!