Skip to content

Instantly share code, notes, and snippets.

@jasoncartwright
Last active August 13, 2018 17:47
Show Gist options
  • Save jasoncartwright/e95e228656ce30610607343f8b83938c to your computer and use it in GitHub Desktop.
Save jasoncartwright/e95e228656ce30610607343f8b83938c to your computer and use it in GitHub Desktop.
Number of IP addresses Google says they own
total=0
for slash in $(dig TXT +short _netblocks{,2,3}.google.com | tr ' ' '\n' | grep '^ip4:' | cut -d '/' -f 2); do
total=$((total+$(echo "2^(32-$slash)" | bc -l)))
done
echo $total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment