Skip to content

A new CLI tool for RDAP that was created since the tool I was using before was getting depreciated - and this one just looks better

Notifications You must be signed in to change notification settings

TheZacillac/rdap-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

RDAP CLI

A Python command-line interface for querying RDAP (Registration Data Access Protocol) servers. RDAP is the modern replacement for WHOIS, providing structured data about domain names, IP addresses, and Autonomous System Numbers (ASNs).

Features

  • Query domain names, IP addresses (IPv4/IPv6), and ASNs
  • Automatic RDAP server discovery using IANA bootstrap services
  • Beautiful formatted output with colors
  • JSON output option for scripting
  • No external dependencies (pure Python 3 standard library)
  • Fast and lightweight

Requirements

  • Python 3.6 or higher
  • No additional packages required (uses only standard library)

Installation

System-wide installation

Run the installation script:

cd rdap-cli
./install.sh

This will install the rdap command to /usr/local/bin (may require sudo).

Manual installation

# Copy the script to a directory in your PATH
sudo cp rdap /usr/local/bin/rdap
sudo chmod +x /usr/local/bin/rdap

Run without installation

./rdap google.com

Usage

Basic queries

# Query a domain name
rdap google.com
rdap example.org

# Query an IP address
rdap 8.8.8.8
rdap 2001:4860:4860::8888

# Query an ASN
rdap AS15169
rdap AS13335

Options

# Get raw JSON output
rdap google.com --json

# Disable colored output
rdap google.com --no-color

# Set custom timeout (default: 10 seconds)
rdap example.com --timeout 30

# Show help
rdap --help

Examples

Domain lookup

$ rdap google.com

Querying RDAP for: google.com

=== Domain Information ===
Domain Name: GOOGLE.COM
Handle: 2138514_DOMAIN_COM-VRSN
Status: client delete prohibited, client transfer prohibited, client update prohibited

Important Dates
---------------
  Registration: 1997-09-15 04:00:00 UTC
  Expiration: 2028-09-14 04:00:00 UTC
  Last Changed: 2019-09-09 15:39:04 UTC

Nameservers
-----------
  - NS1.GOOGLE.COM
  - NS2.GOOGLE.COM
  - NS3.GOOGLE.COM
  - NS4.GOOGLE.COM

Entities
--------
  [Registrar]
    MarkMonitor Inc.
    Handle: 292

IP address lookup

$ rdap 8.8.8.8

Querying RDAP for: 8.8.8.8

=== IP Network Information ===
IP Version: IPv4
Start Address: 8.8.8.0
End Address: 8.8.8.255
Name: GOGL
Type: DIRECT ALLOCATION
Status: active

Entities
--------
  [Registrant]
    Google LLC
    Handle: GOGL

ASN lookup

$ rdap AS15169

Querying RDAP for: AS15169

=== Autonomous System Information ===
ASN: AS15169
Handle: AS15169
Name: GOOGLE
Status: active

Entities
--------
  [Technical]
    Google LLC
    Email: [email protected]
    Phone: +1-650-253-0000

How it works

  1. Query detection: The tool automatically detects whether you're querying a domain, IP, or ASN
  2. Bootstrap discovery: It fetches the appropriate IANA bootstrap file to find the correct RDAP server
  3. RDAP query: It sends an HTTPS request to the RDAP server
  4. Response formatting: The JSON response is formatted into a human-readable output

RDAP vs WHOIS

RDAP (Registration Data Access Protocol) is the successor to WHOIS:

  • Structured data: JSON format instead of free-form text
  • Standardized: RFC 7480-7485 standardization
  • Secure: HTTPS with encryption
  • Better privacy: More granular access controls
  • Internationalization: Full Unicode support
  • Machine-readable: Easy to parse and integrate

Privacy

This tool queries RDAP servers directly via HTTPS. Only the relevant registry sees your query - there's no intermediary proxy.

Uninstallation

sudo rm /usr/local/bin/rdap

Or use the uninstall script:

./uninstall.sh

License

MIT License - See LICENSE file for details

References

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

About

A new CLI tool for RDAP that was created since the tool I was using before was getting depreciated - and this one just looks better

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published