From 678e2ca60ed3290e775cb1a0028b2f03f79f4bf9 Mon Sep 17 00:00:00 2001 From: ddidderr Date: Sun, 3 Apr 2022 23:58:24 +0200 Subject: [PATCH] add test script for useful dig command to test queries against the server --- dig_query.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 dig_query.sh diff --git a/dig_query.sh b/dig_query.sh new file mode 100755 index 0000000..105e307 --- /dev/null +++ b/dig_query.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +if [[ "$1" == "--help" || "$1" == "-h" ]]; then + echo "Usage: ${0} [domain] [record_type]" + exit +fi + +if [[ -n "$1" ]]; then + if [[ -n "$2" ]]; then + dig @127.0.0.1 -p 13337 "$1" "$2" +retry=0 + else + dig @127.0.0.1 -p 13337 "$1" A +retry=0 + fi +else + dig @127.0.0.1 -p 13337 "git.comff.net" A +retry=0 +fi