A collection of Python tools for IP address resolution and network diagnostics. Includes tools for MongoDB Atlas clusters and general hostname resolution.
- Resolves a MongoDB Atlas cluster SRV record to get all associated hostnames
- Resolves each hostname to its IP address
- Outputs a comma-separated list of IPs in
/32CIDR format
- Resolves any hostname to its IP address(es)
- Supports multiple hostnames in a single command
- Verbose mode shows canonical names
- Outputs IPs in
/32CIDR format for easy whitelisting
- Python 3.12+
- Poetry for dependency management
- Clone the repository:
git clone <repo-url> cd ip-tools
- Install dependencies with Poetry:
poetry install
Get IPs for your MongoDB cluster:
poetry run python get_mongo_cluster_ips.py <cluster-url>Example:
poetry run python get_mongo_cluster_ips.py cluster0.mongodb.netOutput:
34.201.32.85/32, 52.23.45.67/32, ...
Resolve any hostname to IP addresses:
poetry run python ip_resolver.py <hostname>Examples:
# Single hostname
poetry run python ip_resolver.py google.com
# Multiple hostnames
poetry run python ip_resolver.py google.com amazon.com cloudflare.com
# AWS RDS endpoint
poetry run python ip_resolver.py wvains.cluster-cavfm4tkbkmt.us-east-1.rds.amazonaws.com
# Verbose mode (shows canonical names)
poetry run python ip_resolver.py -v example.comOutput formats:
# Single hostname
23.22.191.219/32
# Multiple hostnames
google.com:
142.250.80.46/32
amazon.com:
52.94.236.248/32
54.239.28.85/32
205.251.242.103/32
# Verbose mode
Hostname: example.com
Canonical name: example.com
IP addresses:
- 93.184.215.14/32MIT