Command-line interface for IP Science - network intelligence, IP analysis, and infrastructure tools from your terminal.
The IP Science CLI is a Python package that can be installed via pip.
# Install from PyPI
pip install ipscience
# Verify installation
ipscience --version
# Clone the repository
git clone https://github.com/dnsscience/ipscience-cli.git
cd ipscience-cli
# Install in development mode
pip install -e .
The CLI requires authentication to access the IP Science API. You can authenticate using your DNS Science account credentials or an API key.
# Login with email and password
ipscience login
# You'll be prompted for credentials
Email: your@email.com
Password: ********
Login successful! API key saved.
# Set API key directly
ipscience config set-key YOUR_API_KEY
# Or use environment variable
export IPSCIENCE_API_KEY="YOUR_API_KEY"
Configuration is stored in ~/.ipscience/config.json.
Manage CLI configuration settings.
# Show current configuration
ipscience config show
# Set API key
ipscience config set-key YOUR_API_KEY
# Set custom API URL (for enterprise)
ipscience config set-url https://api.enterprise.ipscience.io
# Reset configuration to defaults
ipscience config reset
Authenticate with your DNS Science account. Saves API key for future sessions.
| Option | Description |
|---|---|
| --email EMAIL | Account email (prompts if not provided) |
| --password PASSWORD | Account password (prompts if not provided) |
# Interactive login
ipscience login
# Non-interactive login
ipscience login --email user@example.com --password mypassword
Clear saved authentication credentials.
ipscience logout
# Logged out successfully. API key removed.
View account information, subscription status, and API usage.
# Show account overview
ipscience account show
# View API usage statistics
ipscience account usage
# View subscription details
ipscience account subscription
Account Information
-------------------
Email: user@example.com
Name: John Doe
Tier: Professional
Member Since: 2024-01-15
API Usage (This Month)
----------------------
Requests: 12,450 / 50,000
Rate Limit: 60 req/min
Manage API keys for your account.
| Command | Description |
|---|---|
| list | List all API keys |
| create NAME | Create a new API key |
| delete KEY_ID | Delete an API key |
| disable KEY_ID | Disable an API key |
| enable KEY_ID | Enable a disabled API key |
# List all API keys
ipscience apikey list
# Create new API key
ipscience apikey create "Production Server"
# Disable an API key
ipscience apikey disable key_abc123
# Delete an API key
ipscience apikey delete key_abc123
API Keys
--------
ID Name Status Created
key_abc123 Production Server active 2024-01-15
key_def456 Development active 2024-02-01
key_ghi789 Old Key disabled 2023-11-20
Look up detailed information about an IP address.
| Option | Description |
|---|---|
| --json | Output in JSON format |
| --raw | Show raw API response |
ipscience ip 8.8.8.8
IP Address: 8.8.8.8
----------------
Organization: Google LLC
ASN: AS15169
Location: Mountain View, California, US
Coordinates: 37.4056, -122.0775
Timezone: America/Los_Angeles
Hostname: dns.google
Type: Datacenter
Show your current public IP address and location.
ipscience myip
# Output:
Your IP: 203.0.113.42
Location: Sydney, New South Wales, AU
ISP: Telstra Corporation (AS1221)
Check IP reputation and threat intelligence data.
| Option | Description |
|---|---|
| --json | Output in JSON format |
| --feeds FEEDS | Specific feeds to check (comma-separated) |
ipscience reputation 1.2.3.4
IP Reputation: 1.2.3.4
---------------------
Risk Score: 75/100 (HIGH)
Risk Level: High Risk
Threat Indicators:
- blocklist.de: SSH bruteforce (2024-01-15)
- cins: Scanning activity (2024-01-14)
Flags:
[x] Known Attacker
[ ] Tor Exit Node
[ ] VPN/Proxy
Perform comprehensive IP scan including ports, services, and SSL certificates.
| Option | Description |
|---|---|
| --ports PORTS | Specific ports to scan (default: common ports) |
| --no-ssl | Skip SSL certificate analysis |
| --json | Output in JSON format |
ipscience scan 93.184.216.34
Look up Autonomous System Number details.
| Command | Description |
|---|---|
| ipscience asn 15169 | ASN overview |
| ipscience asn 15169 prefixes | List announced prefixes |
| ipscience asn 15169 peers | Show BGP peers |
ipscience asn 15169
AS15169 - GOOGLE
----------------
Organization: Google LLC
Country: United States
Registry: ARIN
Type: Content
IPv4 Prefixes: 1,200+
IPv6 Prefixes: 500+
Top Prefixes:
8.8.8.0/24
8.8.4.0/24
8.34.208.0/20
Perform visual traceroute with geographic data for each hop.
| Option | Description |
|---|---|
| --max-hops N | Maximum hops (default: 30) |
| --json | Output in JSON format |
ipscience traceroute google.com
Traceroute to google.com (142.250.190.78)
-----------------------------------------
Hop IP RTT Location ASN
1 192.168.1.1 1ms (private) -
2 203.0.113.1 12ms Sydney, AU AS1221
3 203.0.113.50 15ms Sydney, AU AS1221
4 72.14.223.81 45ms Los Angeles, US AS15169
5 142.250.190.78 48ms Los Angeles, US AS15169
Total: 5 hops, 48ms
Get BGP routing information for an IP address.
ipscience bgp 8.8.8.8
BGP Information: 8.8.8.8
------------------------
Prefix: 8.8.8.0/24
Origin ASN: AS15169 (Google LLC)
AS Path: AS15169
RPKI Status: Valid
RIR: ARIN
First Seen: 2009-01-01
WHOIS lookup for IP address or ASN.
ipscience whois 8.8.8.8
ipscience whois AS15169
Perform bulk operations on multiple IPs.
| Command | Description |
|---|---|
| bulk ip FILE | Bulk IP lookup from file |
| bulk reputation FILE | Bulk reputation check |
| bulk asn FILE | Bulk ASN lookup |
| Option | Description |
|---|---|
| --output FILE | Output file (default: stdout) |
| --format FORMAT | Output format: json, csv, table |
| --concurrency N | Parallel requests (default: 10) |
# Bulk IP lookup
ipscience bulk ip ips.txt --output results.json
# Bulk reputation check
ipscience bulk reputation suspicious_ips.txt --format csv
# Input file format (one IP per line):
# 8.8.8.8
# 1.1.1.1
# 9.9.9.9
Commands marked with PRO require a Professional or Enterprise subscription. View pricing
RANCID-NG (Really Awesome New Cisco confIg Differ - Next Generation) is a network device configuration management and backup tool. It monitors network device configurations and maintains version control history.
RANCID-NG is a separate tool for network infrastructure management. Use it alongside IP Science for comprehensive network intelligence.
# Install RANCID-NG
sudo apt-get install rancid-ng
# Or via pip
pip install rancid-ng
| Vendor | Device Types |
|---|---|
| Cisco | IOS, IOS-XE, IOS-XR, NX-OS, ASA, Firepower |
| Juniper | Junos, ScreenOS |
| Arista | EOS |
| Fortinet | FortiOS |
| Palo Alto | PAN-OS |
| F5 | BIG-IP |
| HP/Aruba | ProCurve, ArubaOS |
# Initialize RANCID group
rancid-cvs router-group
# Add devices to router.db
echo "router1.example.com:cisco:up" >> /var/rancid/router-group/router.db
# Run configuration collection
rancid-run
# View configuration diff
cd /var/rancid/router-group/configs
cvs diff -u router1.example.com
Combine RANCID-NG with IP Science CLI for powerful network management:
# Get device info from IP Science, then backup config
ipscience ip 192.168.1.1 --json > device_info.json
rancid-run -g core-routers
# Check reputation before adding new device
ipscience reputation 10.0.0.1
echo "10.0.0.1:cisco:up" >> router.db