Skip to content

Instantly share code, notes, and snippets.

@nic
Created April 3, 2018 01:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nic/8a5429aa1aaa77d7f052143f6d2d074f to your computer and use it in GitHub Desktop.
Save nic/8a5429aa1aaa77d7f052143f6d2d074f to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ -z "$1" ]; then
echo -e "Usage:\n $0 address\n\nEx: $0 google.com"
exit 0
fi
for ip in `nslookup $1 |grep Address|grep -v 53 |cut -d":" -f2|cut -d' ' -f2`; do
echo "$ip -> $(ping -c 1 "$ip" | grep time |cut -d'=' -f4)";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment