Created
June 15, 2025 08:43
-
-
Save dexhunter/21c37c81902cb00416644ba5bcae7e52 to your computer and use it in GitHub Desktop.
ai domain available check (alab -> zlab)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Check alab.ai … zlab.ai using RDAP (https over 443, no WHOIS needed) | |
""" | |
import string, time, requests | |
RDAP = "https://rdap.identitydigital.services/rdap/domain/{}" | |
def is_available(domain: str) -> bool | None: | |
r = requests.get(RDAP.format(domain), timeout=10) | |
if r.status_code == 404: # RDAP: 404 means “domain not found” | |
return True | |
if r.status_code == 200: | |
return False | |
if r.status_code == 429: # too many queries – back off | |
time.sleep(2) | |
return is_available(domain) | |
return None # network / server error | |
for ch in string.ascii_lowercase: | |
d = f"{ch}lab.ai" | |
status = is_available(d) | |
label = {True: "AVAILABLE", False: "REGISTERED"}.get(status, "UNKNOWN") | |
print(f"{d:10s} {label}") | |
time.sleep(0.2) # 5 req/s ≈ registry’s comfort zone |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment