Skip to content

Instantly share code, notes, and snippets.

@jmaziarz
Created April 26, 2011 21:47
Show Gist options
  • Save jmaziarz/943256 to your computer and use it in GitHub Desktop.
Save jmaziarz/943256 to your computer and use it in GitHub Desktop.
Map a subnet using dig - quick and dirty
#!/bin/bash
# Usage: ./map-subnet.sh 129.38.11
#
SUBNET=$1
for n in {1..254}; do
ADDR=${SUBNET}.${n}
echo -e "${ADDR}\t$(dig -x ${ADDR} +short)"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment