CLI Reference
Account Commands
IP Commands
Network Commands
Bulk Operations
Other CLI Tools

Installation

The IP Science CLI is a Python package that can be installed via pip.

Quick Install

# Install from PyPI
pip install ipscience

# Verify installation
ipscience --version

Requirements

  • Python 3.8 or higher
  • pip package manager
  • DNS Science account (free tier available)

Installation from Source

# Clone the repository
git clone https://github.com/dnsscience/ipscience-cli.git
cd ipscience-cli

# Install in development mode
pip install -e .

Authentication

The CLI requires authentication to access the IP Science API. You can authenticate using your DNS Science account credentials or an API key.

Interactive Login

# Login with email and password
ipscience login

# You'll be prompted for credentials
Email: your@email.com
Password: ********
Login successful! API key saved.

API Key Authentication

# Set API key directly
ipscience config set-key YOUR_API_KEY

# Or use environment variable
export IPSCIENCE_API_KEY="YOUR_API_KEY"

Configuration

Configuration is stored in ~/.ipscience/config.json.

ipscience config

Manage CLI configuration settings.

Subcommands

# 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

login

ipscience login

Authenticate with your DNS Science account. Saves API key for future sessions.

Options

OptionDescription
--email EMAILAccount email (prompts if not provided)
--password PASSWORDAccount password (prompts if not provided)

Example

# Interactive login
ipscience login

# Non-interactive login
ipscience login --email user@example.com --password mypassword

logout

ipscience logout

Clear saved authentication credentials.

ipscience logout
# Logged out successfully. API key removed.

account

ipscience account

View account information, subscription status, and API usage.

Subcommands

# Show account overview
ipscience account show

# View API usage statistics
ipscience account usage

# View subscription details
ipscience account subscription

Example Output

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

apikey

ipscience apikey

Manage API keys for your account.

Subcommands

CommandDescription
listList all API keys
create NAMECreate a new API key
delete KEY_IDDelete an API key
disable KEY_IDDisable an API key
enable KEY_IDEnable a disabled API key

Examples

# 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

Example Output

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

ip

ipscience ip IP_ADDRESS

Look up detailed information about an IP address.

Options

OptionDescription
--jsonOutput in JSON format
--rawShow raw API response

Example

ipscience ip 8.8.8.8

Output

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

myip

ipscience myip

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)

reputation

ipscience reputation IP_ADDRESS

Check IP reputation and threat intelligence data.

Options

OptionDescription
--jsonOutput in JSON format
--feeds FEEDSSpecific feeds to check (comma-separated)

Example

ipscience reputation 1.2.3.4

Output

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

scan

ipscience scan IP_ADDRESS PRO

Perform comprehensive IP scan including ports, services, and SSL certificates.

Options

OptionDescription
--ports PORTSSpecific ports to scan (default: common ports)
--no-sslSkip SSL certificate analysis
--jsonOutput in JSON format

Example

ipscience scan 93.184.216.34

asn

ipscience asn ASN

Look up Autonomous System Number details.

Subcommands

CommandDescription
ipscience asn 15169ASN overview
ipscience asn 15169 prefixesList announced prefixes
ipscience asn 15169 peersShow BGP peers

Example

ipscience asn 15169

Output

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

traceroute

ipscience traceroute TARGET

Perform visual traceroute with geographic data for each hop.

Options

OptionDescription
--max-hops NMaximum hops (default: 30)
--jsonOutput in JSON format

Example

ipscience traceroute google.com

Output

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

bgp

ipscience bgp IP_ADDRESS PRO

Get BGP routing information for an IP address.

Example

ipscience bgp 8.8.8.8

Output

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

ipscience whois TARGET

WHOIS lookup for IP address or ASN.

Example

ipscience whois 8.8.8.8
ipscience whois AS15169

bulk

ipscience bulk PRO

Perform bulk operations on multiple IPs.

Subcommands

CommandDescription
bulk ip FILEBulk IP lookup from file
bulk reputation FILEBulk reputation check
bulk asn FILEBulk ASN lookup

Options

OptionDescription
--output FILEOutput file (default: stdout)
--format FORMATOutput format: json, csv, table
--concurrency NParallel requests (default: 10)

Example

# 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
Professional Features

Commands marked with PRO require a Professional or Enterprise subscription. View pricing

RANCID-NG

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 Overview

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

Key Features

  • Configuration Backup: Automated backup of router, switch, and firewall configurations
  • Version Control: Track configuration changes over time with CVS/SVN/Git integration
  • Multi-Vendor Support: Supports Cisco, Juniper, Arista, Fortinet, Palo Alto, and many more
  • Change Notifications: Email alerts when device configurations change
  • Diff Reports: See exactly what changed between configuration versions

Supported Device Types

VendorDevice Types
CiscoIOS, IOS-XE, IOS-XR, NX-OS, ASA, Firepower
JuniperJunos, ScreenOS
AristaEOS
FortinetFortiOS
Palo AltoPAN-OS
F5BIG-IP
HP/ArubaProCurve, ArubaOS

Basic Usage

# 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

Integration with IP Science

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