When you set up email for your domain (for example, creating SPF records), you might need the IP addresses of the G Suite mail servers.
Google maintains a global infrastructure that grows dynamically to accommodate demand. As a result, G Suite mail servers use a large range of IP addresses, and the addresses often change. You can find the current range of Gmail IP addresses by checking Google's SPF record.
Set up SPF records
To set up G Suite SPF records, follow the instructions here.
Gather IP address ranges
To find the literal IP addresses of G Suite mail servers:
- Use DNS lookup commands (nslookup, dig, host) to retrieve the SPF records for the domain _spf.google.com:
nslookup -q=TXT _spf.google.com 188.8.131.52
This returns a list of the domains included in Google's SPF record, such as:
_netblocks.google.com, _netblocks2.google.com, _netblocks3.google.com
- Look up the DNS records associated with those domains, one at a time:
nslookup -q=TXT _netblocks.google.com 184.108.40.206
nslookup -q=TXT _netblocks2.google.com 220.127.116.11
nslookup -q=TXT _netblocks3.google.com 18.104.22.168
The results contain the current range of addresses.