aboutsummaryrefslogtreecommitdiff
path: root/templates/.bin/rev_dns
diff options
context:
space:
mode:
Diffstat (limited to 'templates/.bin/rev_dns')
-rwxr-xr-xtemplates/.bin/rev_dns7
1 files changed, 7 insertions, 0 deletions
diff --git a/templates/.bin/rev_dns b/templates/.bin/rev_dns
new file mode 100755
index 0000000..604774c
--- /dev/null
+++ b/templates/.bin/rev_dns
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+if [[ "$#" != "1" ]]; then
+ echo "usage: $0 <hostname>"
+else
+ dig +short "$1" | awk '/^([0-9]{1,3}\.){3}[0-9]{1,3}$/{print $0}' | xargs -I _ dig +short -x _
+fi