Skip to content

Instantly share code, notes, and snippets.

@natemccurdy
Created December 3, 2019 22:47
Show Gist options
  • Save natemccurdy/43e9b2913c0d0c2be812d39fad212f66 to your computer and use it in GitHub Desktop.
Save natemccurdy/43e9b2913c0d0c2be812d39fad212f66 to your computer and use it in GitHub Desktop.
Show the network blocks used by googleapis.com
#!/usr/bin/env bash
netblocks=$(dig TXT _spf.google.com +short | grep -E -o "include:_netblocks\d?\.google\.com" | sed 's/include://')
{
for net in $netblocks; do
dig TXT "$net" +short
done
} | grep -E -o "ip4:[0-9\./]+" | sed 's/ip4://' | sort -V
@natemccurdy
Copy link
Author

 ~$  googleapi-netblocks
35.190.247.0/24
35.191.0.0/16
64.233.160.0/19
66.102.0.0/20
66.249.80.0/20
72.14.192.0/18
74.125.0.0/16
108.177.8.0/21
108.177.96.0/19
130.211.0.0/22
172.217.0.0/19
172.217.32.0/20
172.217.128.0/19
172.217.160.0/20
172.217.192.0/19
172.253.56.0/21
172.253.112.0/20
173.194.0.0/16
209.85.128.0/17
216.58.192.0/19
216.239.32.0/19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment