Skip to content

Instantly share code, notes, and snippets.

@MarkZhangTW
Last active March 28, 2020 07:30
Show Gist options
  • Save MarkZhangTW/50000ea93a4b4281a02e1d27f5348ef5 to your computer and use it in GitHub Desktop.
Save MarkZhangTW/50000ea93a4b4281a02e1d27f5348ef5 to your computer and use it in GitHub Desktop.
bash reverse DNS name with dig
for i in {1..254}; do
lookup=$(dig -x 192.168.0.$i +short);
[[ -z "$lookup" ]] || echo "192.168.0.$(printf %3s $i)" - $lookup;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment