I wanted to find the IP ranges for all of Amazon's US-based S3 regions. After a lot of searching through outdated forums, I found out how to get the ranges directly from the source. The Amazon Simple Storage Service (S3) is broken up into buckets that are stored in different regions. Currently, there are three US regions documented. I had to search for their actual hosts names which are documented in the AWS Java SDK.
whois. Host is a DNS lookup utility that resolves a host to an IP.
$ host s3-us-west-1.amazonaws.com s3-us-west-1.amazonaws.com has address 184.108.40.206Now that I have the IP, I can run
whoison it to find its NetRange. Since
whoisalso returns a bunch of other information, I grepped for exactly what I wanted.
$ whois 220.127.116.11 | grep NetRange NetRange: 18.104.22.168 - 22.214.171.124Now I have the IP range for the US West (Northern-California) S3 region. A note about the US Standard region: s3.amazonaws.com is actually aliased between s3-1.amazonaws.com and s3-2.amazonaws.com so I had to
whoisboth of those hosts.
$ host s3.amazonaws.com s3.amazonaws.com is an alias for s3.geo.amazonaws.com. s3.geo.amazonaws.com is an alias for s3-2.amazonaws.com. s3-2.amazonaws.com has address 126.96.36.199