Skip to content

Conversation

@Josh-XT
Copy link
Owner

@Josh-XT Josh-XT commented Jan 28, 2026

Summary

Adds a new check_domain_availability(domain: str) -> bool function to the essential_abilities extension that allows agents to check if a domain name is available for registration.

Changes

  • Added new async function check_domain_availability to essential_abilities.py

Implementation Details

  • Primary method: Uses the python-whois library to perform WHOIS lookups
  • Fallback method: Falls back to DNS resolution check if python-whois is not installed
  • Input validation: Validates domain format using regex, handles protocols (http/https), www prefix, and paths
  • Return value: Returns True if domain is available, False if registered or on error
  • Error handling: Comprehensive error handling with logging for debugging

Usage Example

# Check if a domain is available
available = await check_domain_availability("example.com")
# Returns False (domain is registered)

available = await check_domain_availability("some-unregistered-domain-12345.com")
# Returns True (domain is available)

Testing

  • Function syntax validated with py_compile
  • Follows existing code style and documentation patterns in the file

Dependencies

  • Optionally uses python-whois library for accurate WHOIS lookups
  • Falls back to built-in socket module for DNS-based checking if python-whois unavailable

- Add new async function check_domain_availability(domain: str) -> bool
- Uses python-whois library for WHOIS lookup to check domain registration
- Falls back to DNS lookup if python-whois is not installed
- Includes comprehensive input validation and domain cleaning
- Handles protocols (http/https), www prefix, and paths gracefully
- Returns True if domain is available, False if registered or on error
- Follows existing code style with proper docstrings and error handling
@Josh-XT Josh-XT merged commit 9501a0f into main Jan 28, 2026
10 checks passed
@Josh-XT Josh-XT deleted the feature/domain-availability branch January 28, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants