Google IP address ranges for outbound SMTP
When you set up email for your domain (for example, 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 Google IP addresses by checking Google's SPF record.
To create an SPF record for your domain, you can simply have the record refer to the Google SPF record. Your domain automatically inherits changes to the Google IP addresses.
v=spf1 include:_spf.google.com ~all
For the literal IP addresses of G Suite mail servers, use DNS lookup commands (
host) to retrieve the SPF records for the domain _spf.google.com:
nslookup -q=TXT _spf.google.com 220.127.116.11
This returns a list of the domains included in Google's SPF record, such as:
_netblocks.google.com, _netblocks2.google.com, _netblocks3.google.com
Now look up the DNS records associated with those domains, one at a time:
nslookup -q=TXT _netblocks.google.com 18.104.22.168
nslookup -q=TXT _netblocks2.google.com 22.214.171.124
nslookup -q=TXT _netblocks3.google.com 126.96.36.199
The results contain the current range of addresses.
Note: These netblocks also include IP addresses for all other G Suite services (for example, docs.google.com or drive.google.com). However, because mail can be served from any point in Google’s infrastructure, it’s important to include all of these records.