cloudip is a CLI tool that identifies which cloud provider manages the given IP address. You can input a single or multiple IPs, and the results can be displayed in various formats, such as table, json.
🚨 Warning 🚨
This project is currently under development, and features and options may change without notice until the official release.
- Single IP Check: Identify which cloud provider owns a specific IP.
- Multiple IP Check: Check multiple IP addresses at once.
- IPv4 and IPv6 Support: Supports both IPv4 and IPv6 addresses.
- Format Output: Display results in various formats using the
--formatoption. - Cached Provider Updates: Provider data update checks are cached for 24 hours by default.
- AWS: Amazon Web Services
- GCP: Google Cloud Platform
- Azure: Microsoft Azure
- Cloudflare: Cloudflare, Inc.
- OCI: Oracle Cloud Infrastructure
- Vultr: The Constant Company
- DigitalOcean: DigitalOcean, LLC
brew tap jongwoo328/cloudip
brew trust --tap jongwoo328/cloudip
brew install cloudipNote: The AUR package is no longer maintained.
cloudip is available as a package on the AUR.
You can install it using an AUR helper (e.g., yay):
yay -S cloudipDownload the latest binary from the Releases page.
Supported Platforms:
- Linux (x86)
- Linux (x86_64)
- Linux (ARM64)
- macOS (x86_64)
- macOS (ARM64)
IP lookups require at least one IP argument: cloudip IP [IP...]. Use --help or version without an IP.
-
Version Check
cloudip version
Output:
0.12.0 -
Single IP Check
cloudip 54.230.176.25
Output:
54.230.176.25 aws -
Multiple IP Check
cloudip 54.230.176.25 54.230.176.30 54.230.176.45
Output:
54.230.176.25 aws 54.230.176.30 aws 54.230.176.45 aws
-
You can specify a custom delimiter for the output. The default delimiter is a space.
-
Comma (,) Delimited
cloudip 54.230.176.25 --delimiter=','Output:
54.230.176.25,aws -
Tab (\t) Delimited
cloudip 54.230.176.25 --delimiter=$'\t'Output:
54.230.176.25 aws
and any other custom delimiters can be used.
-
-
Use the
--formatoption to specify the output format. Supported formats include:-
text(default): Displays results as simple text.cloudip 54.230.176.25 --format=text
Output:
54.230.176.25 awsUse the
--headeroption to include a header row.cloudip 54.230.176.25 --format=text --header
Output:
IP Provider 54.230.176.25 aws -
table: Displays results in a table format. Columns are padded with spaces for alignment, making it easy to read. The header is always displayed.cloudip 54.230.176.25 --format=table
Output:
IP Provider 54.230.176.25 awsThe
--delimiteroption can also be used with thetableformat.cloudip 54.230.176.25 --format=table --delimiter=' | 'Output:
IP | Provider 54.230.176.25 | aws -
json: Outputs results in JSON format, suitable for parsing with tools likejq.cloudip 54.230.176.25 --format=json
Output:
[{"ip":"54.230.176.25","provider":"aws","error":""}]JSON output uses lowercase keys:
ip,provider, anderror. If an IP check fails,provideris set toerrorand theerrorfield contains the reason. -
csv: This tool does not have a direct--format=csvoption. However, you can produce CSV-like output by combining--format=textwith--delimiter=','. To include a header row, also add the--headeroption.cloudip 54.230.176.25 --format=text --delimiter=',' --headerOutput:
IP,Provider 54.230.176.25,aws
-
-
Verbose Output The
--verbose,-voption writes diagnostic logs to stderr and lookup results to stdout. With--format=json --verbose, stdout remains valid JSON.cloudip --verbose 54.230.176.25
Example stderr (varies with cache state):
AWS IP ranges file does not exist. Downloading AWS IP ranges... AWS IP ranges updated [2024-12-27 04:12:30]stdout:
54.230.176.25 aws -
Skip Provider Data Updates By default,
cloudipchecks provider data updates at most once every 24 hours when local data files already exist. Use--no-updateto skip provider update checks and use only local data.cloudip --no-update 54.230.176.25
If the required local provider data file is missing,
--no-updatereturns an error instead of downloading it.
Each data download request has a 30-second timeout, including reading the response body. This is not a timeout for the entire command; multiple providers or requests can take longer overall.
If an update download or data validation fails, a valid existing cache can still be used, with diagnostics written to stderr. Failed downloads and invalid data do not overwrite the existing cache. If no usable cache is available, initialization of that provider fails.
JSON downloads and caches use case-sensitive field matching. Duplicate object names, invalid UTF-8, and trailing JSON data are rejected. Existing valid caches remain readable.
When checking multiple IPs in one batch, a provider that fails initialization is not initialized again in that batch. Other healthy providers are still checked, and a subsequent invocation retries the failed provider.
Missing IP arguments or an unsupported --format value (including an empty value) cause an error before provider initialization or lookup, without printing result rows. Missing IP arguments also produce a usage hint.
Cache permission errors, invalid paths, and directories where files are expected are reported as file access errors. If the application storage directory cannot be created, the command writes diagnostics to stderr and exits with a non-zero status code.
After argument validation succeeds, if one or more IP checks fail, cloudip still prints all result rows and exits with a non-zero status code. In text and table formats, failed rows show ERROR in the provider column and detailed error messages are written to stderr. In json format, each row includes an error field.
- Ensure that Go is installed (Go v1.27.3 or later is needed).
- Clone and build the project:
git clone https://github.com/jongwoo328/cloudip.git cd cloudip go mod tidy go build -trimpath -o build/cloudip --ldflags '-X cloudip/cmd.Version=0.12.0'
- The binary
cloudipwill be generated in thebuild/directory.
Note for Maintainers: For release builds, use make build which uses GoReleaser for cross-platform compilation and distribution.
Run the test suite using the following commands:
# Run all tests
make test
# Run tests with verbose output
make test-verbose
# Run tests with coverage report
make test-coverage
# Run benchmark tests
make test-benchThis project is licensed under the Apache License 2.0.
You may use this project in compliance with the terms and conditions of the Apache 2.0 License. For more details, see the LICENSE file or visit the official Apache License website.