Skip to content

Instantly share code, notes, and snippets.

@greencm
Created October 30, 2013 15:42
Show Gist options
  • Save greencm/7234836 to your computer and use it in GitHub Desktop.
Save greencm/7234836 to your computer and use it in GitHub Desktop.
Display current google IPv4 Netblocks
dig -t txt _netblocks.google.com | grep spf | perl -nle 'split; for(@_) { if ($_ =~ m/^ip4/) { print substr($_,4); } }'
@JustinAzoff
Copy link

Apparently @_ is deprecated in newer perls, this works for me:

dig -t txt _netblocks.google.com | grep spf | perl -nle 'for(split) {if ($_ =~ m/^ip4/) { print substr($_,4); } }'

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