Skip to main content

Digital Ocean

The cipr do command retrieves IP ranges for Digital Ocean.

Usage

CLI command
cipr do [flags]

Data Format

See the Digital Ocean command data format for output fields and filter-value guidance.

Flags

FlagDescriptionDefaultRequiredMultiple values
--ipv4Get only IPv4 ranges.
--ipv6Get only IPv6 ranges.
--filter-countryFilter results by country.
--filter-regionFilter results by region.
--filter-cityFilter results by city (use quotes for names with spaces, e.g. "New York").
--filter-zipFilter results by ZIP code.
--listList unique values for a dimension instead of IP ranges. Valid: countries, regions, cities, zips.

When neither --ipv4 nor --ipv6 is set, both are fetched. --list composes with the --filter* flags but ignores --ipv4/--ipv6.

Source and caching

The configured source key is digitalocean, with these default settings:

digitalocean_endpoint = "https://digitalocean.com/geo/google.csv"
digitalocean_local_file = ""
digitalocean_cache_ttl = "24h"

Use cipr configure digitalocean to inspect the effective values. Custom URLs and local files supplied through --source must use the same CSV format as DigitalOcean's geo/google.csv feed.

Use --no-cache when a run must fetch the current publication instead of a valid cached response.

Examples

tip

IP ranges in the output examples are snapshots and might not be current.

Get all Digital Ocean IPv4 ranges

CLI command
cipr do --ipv4
Output
...
198.211.118.0/23
198.211.120.0/21
...

Get all Digital Ocean IPv6 ranges

CLI command
cipr do --ipv6
Output
...
2a03:b0c0:0:1050::/64
2a03:b0c0:0:1051::/64
...

Filter results by country

CLI command
cipr do --filter-country US
Output
...
159.65.32.0/20
2604:a880:2:d0::/64
...

Filter results by region

CLI command
cipr do --filter-region US-SF
Output
...
198.199.116.0/24
2604:a880:1:20::/64
...

Filter results by city

CLI command
cipr do --filter-city "New York"
Output
...
192.241.177.0/24
2604:a880:0:2023::/64
...

Filter results by ZIP

CLI command
cipr do --filter-zip 94124
Output
...
198.199.115.0/24
2604:a880:1:20::/64
...

Set verbosity level to full

CLI command
cipr do --ipv6 --filter-country US -v
Output
...
IP Range: 2604:a880:1:4a::/64, Country: US, Region: US-SF, City: San Francisco, ZIP: 94124
IP Range: 2604:a880:2:d0::/64, Country: US, Region: US-CA, City: Santa Clara, ZIP: 95051
...

List all countries

CLI command
cipr do --list countries
Output
...
DE
NL
SG
US
...

List cities in the Netherlands

CLI command
cipr do --filter-country NL --list cities
Output
Amsterdam