How to find Gmail IP ranges

It is useful to know Gmail’s IP ranges for whitelisting in your firewall.

dig _spf.google.com txt

You’ll notice that 3 results are returned _netblocks.google.com, _netblocks2.google.com and _netblocks3.google.com. You’ll need to query each of these in order to get the full IP range Gmail uses.

dig _netblocks.google.com txt
dig _netblocks2.google.com txt
dig _netblocks3.google.com txt

The first and third DIG results will return IPv4 address ranges, and the second DIG result will return IPv6 address ranges.