A collection of Python scripts for checking domain name availability using both traditional WHOIS and modern RDAP protocols.
- Bulk TLD Checker (
lookup.py) - Check domain availability across all 1,500+ TLDs - RDAP Lookup (
rdap_bootstrap.py) - Modern RDAP protocol for detailed domain information - SQLite Database - Store all lookups with full history tracking
- Query Tool (
query_history.py) - Interactive menu or CLI subcommands to view historical data - Automatic rate limiting to prevent server blocks
- Results saved to organized output files
- Real-time progress tracking
cd /path/to/python-whoispython3 -m venv venv
source venv/bin/activatepip install -r requirements.txtChecks a single domain name across all available TLDs (e.g., checks "mysite" against .com, .net, .org, etc.).
Interactive (prompts for a label when no domain is given):
python3 lookup.pyScripted:
python3 lookup.py mysite
python3 lookup.py mysite --tlds custom_tlds.txt
python3 lookup.py --helpArguments:
domain— domain label without TLD (required for non-interactive use)--tlds FILE— TLD list file (default:tlds.txt)
Output Files:
{domain_name}_available.txt- List of available domains{domain_name}_registered.txt- List of registered domains
Features:
- Checks 1,500+ TLDs automatically
- 1-second rate limiting between queries
- Real-time progress with ✓/✗ indicators
- Can be interrupted with Ctrl+C (progress saved)
- Estimated time: 25-30 minutes for full scan
Example (interactive):
Enter domain name (without TLD extension): mysite
Loading TLD list...
Found 1503 TLDs to check.
Checking availability (this may take a while)...
✓ mysite.com - AVAILABLE
✗ mysite.net - registered
✓ mysite.org - AVAILABLE
...
Results saved to:
- mysite_available.txt
- mysite_registered.txt
Uses modern RDAP protocol to check individual domains with detailed registration information. All lookups are automatically saved to SQLite database for historical tracking.
Interactive (prompts for a domain when none is given):
python3 rdap_bootstrap.pyScripted:
python3 rdap_bootstrap.py example.com
python3 rdap_bootstrap.py example.com --db /tmp/lookups.db
python3 rdap_bootstrap.py --helpArguments:
domain— full domain name such asexample.com(required for non-interactive use)--db PATH— SQLite database path (default:domain_lookups.db)
Output:
- SQLite Database (
domain_lookups.db) - All lookups stored with full history {domain_name}_rdap_available.txt- Available domains (appended){domain_name}_rdap_registered.txt- Registered domains with details (appended)
Features:
- SQLite database storage - Full historical tracking
- Detailed registration information
- Registrar name
- Registration and expiration dates
- Domain status codes
- Historical lookup tracking (shows previous checks)
- No rate limiting needed (single query)
Example (interactive):
Database initialized: domain_lookups.db
Enter domain to check (e.g., example.com): google.com
Checking: google.com
✓ Saved to database
Result:
{
"available": false,
"registered": "1997-09-15T04:00:00Z",
"expires": "2028-09-14T04:00:00Z",
"last_changed": "2025-12-31T18:15:21Z",
"statuses": [
"client delete prohibited",
"client transfer prohibited"
],
"registrar": "MarkMonitor Inc."
}
Domain saved to google_com_rdap_registered.txt
📊 Historical lookups for google.com: 3 total
Most recent checks:
1. 2025-12-31T18:15:21Z - Registered
2. 2025-12-30T10:20:15Z - Registered
3. 2025-12-29T14:05:32Z - Registered
Query the SQLite database and view historical lookup data. With no command, the interactive menu is shown. Pass a subcommand to run a single query and exit.
Interactive:
python3 query_history.pyScripted:
python3 query_history.py list
python3 query_history.py history example.com
python3 query_history.py available
python3 query_history.py expiring --days 30
python3 query_history.py recent --limit 10
python3 query_history.py stats
python3 query_history.py --db /tmp/lookups.db stats
python3 query_history.py --helpCommands:
list— all domains in the databasehistory DOMAIN— complete history for one domainavailable— domains available at last checkexpiring [--days N]— domains expiring within N days (default: 90)recent [--limit N]— most recent lookups (default: 20)stats— database statistics
Global options:
--db PATH— SQLite database path (default:domain_lookups.db)
Features:
- View all domains in database
- Show complete history for any domain
- List available domains
- Find domains expiring soon
- View recent lookups
- Database statistics
Example Menu:
============================================================
Domain Lookup History Query Tool
============================================================
1. List all domains
2. View domain history
3. Show available domains
4. Show domains expiring soon
5. Show recent lookups
6. Database statistics
0. Exit
============================================================
📊 Database Statistics
============================================================
Total lookups: 47
Unique domains: 23
Available: 12
Registered: 35
First lookup: 2025-12-30T10:15:32Z
Last lookup: 2025-12-31T18:15:21Z
lookup.py- Bulk domain checker using WHOISrdap_bootstrap.py- RDAP protocol checker with SQLite storagequery_history.py- Interactive menu or CLI to query lookup historytlds.txt- Official IANA TLD list (auto-downloaded)requirements.txt- Python dependenciesdomain_lookups.db- SQLite database (auto-created)- Output text files created during execution
- Python 3.7+
- Dependencies:
python-whois- WHOIS protocol clientrequests- HTTP requests for RDAPpython-dateutil- Date parsing
- WHOIS servers enforce rate limits (1-10 queries/second)
lookup.pyincludes 1-second delays to prevent blocks- Adjust
time.sleep(1)if needed, but be cautious - RDAP queries are typically less restrictive
- WHOIS lookups may fail for some TLDs (server issues, restrictions)
- Some registries return different response formats
lookup.pysupports both old and currentpython-whoisexception names when handling "domain not found" responses- Available status should be verified before registration
- Results are appended to files, allowing multiple runs
- SQLite database stores complete history for trend analysis
- Database queries show how domain status changes over time
- Useful for monitoring domains you're tracking
MIT License - Free to use and modify