Skip to content

Commit

Permalink
add reverse dns convenience script
Browse files Browse the repository at this point in the history
  • Loading branch information
iss committed Oct 16, 2015
1 parent 5b65942 commit f17cd17
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions dig-rev
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

CMD=`which dig`

if [[ ! -x "${CMD}" ]] ;then
echo "dig not found - install and run again"
exit 1
fi

HOST=$1

if [[ -z "$HOST" ]]; then
echo "usage: dig-reg <hostname>"
exit 1
fi

DIG_FORW=`dig ${HOST} | grep "^${HOST}." | awk '{print $5}'`

if [[ -z "$DIG_FORW" ]]; then
echo "could not forward resolve $HOST"
exit 1
fi
dig -x

0 comments on commit f17cd17

Please sign in to comment.