aboutsummaryrefslogtreecommitdiff
path: root/templates/.bin/rev_dns
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2019-08-13 14:40:54 -0400
committerBen Burwell <ben@benburwell.com>2019-08-13 14:40:54 -0400
commitc09d91fe95fca4367f47c06fc808cd02a1a8e6a5 (patch)
tree6c5c8dee0c219ab701dc1ff4c39e905dbac08e70 /templates/.bin/rev_dns
add bins
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