Skip to content

Instantly share code, notes, and snippets.

@IAmStoxe
Last active July 23, 2020 02:49
Show Gist options
  • Select an option

  • Save IAmStoxe/60d2921b4507bb683a4e3ce1976e71e2 to your computer and use it in GitHub Desktop.

Select an option

Save IAmStoxe/60d2921b4507bb683a4e3ce1976e71e2 to your computer and use it in GitHub Desktop.
How to query the current IP ranges of google cloud platform
#!/bin/bash
{
nslookup -q=TXT _cloud-netblocks1.googleusercontent.com 8.8.8.8
nslookup -q=TXT _cloud-netblocks2.googleusercontent.com 8.8.8.8
nslookup -q=TXT _cloud-netblocks3.googleusercontent.com 8.8.8.8
nslookup -q=TXT _cloud-netblocks4.googleusercontent.com 8.8.8.8
nslookup -q=TXT _cloud-netblocks5.googleusercontent.com 8.8.8.8
} | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\/[0-9]\{1,\}' | sort -u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment