← blog  /  tools

Check domain availability in Python with RDAP: 150 of 150 four-letter .com names were taken

2026-11-30  ·  7 min read  ·  tools

RDAP is the open successor of WHOIS: ask the registry of the TLD, and a 404 means no one has registered the name. We asked 490 names on 3 November 2026. All 150 random four-letter .com names were taken, and 13 of 50 random five-letter ones. The Python code, and the 404s that do not mean free.

RDAP is the public successor of WHOIS: the registry that runs a TLD says over HTTPS, in JSON, whether it has a record for a name. IANA publishes which server answers for which TLD in one file, so a check is two requests: the file once, then the name at its registry. A 200 means registered; a 404 means the registry has no record of the name.

On 3 November 2026 we asked 490 names this way: random four- and five-letter .com names, and 40 everyday English words in seven extensions. robots.txt of every server leaves the lookups open, and we waited 1.1 seconds between requests for one extension.

The short version#

  • Four-letter .com: all taken in our sample. We drew 150 random names of four letters, a to z, and all 150 were registered. With 150 names that puts the share taken at 97.5 to 100 % (95 % interval). If free ones exist, they are rare.
  • Five letters: random strings are mostly free, names you can say are not. 13 of 50 random five-letter strings were registered (26 %). Of 50 names built consonant, vowel, consonant, vowel, consonant, 40 were (80 %); dawub.com, kizez.com and zeziw.com were among the 10 free.
  • Everyday words are gone almost wherever RDAP answers. Of 40 words such as apple, coffee and garden, all 40 were registered in .com, .net, .org and .ai, 39 in .app and 37 in .dev. The four called free (cloud, house and music in .dev, cloud in .app) need a second look, see the traps.
  • .io does not answer at all. IANA's file lists no RDAP server for .io, and none for .co or .me. It lists 1,203 TLDs that have one, on 379 hosts.
  • The answers are fast. Median 31 ms for .com (290 answers) and 42 ms for .net (40) from rdap.verisign.com, 157 ms for .dev and .app (80) from pubapi.registry.google, 200 ms for .ai (40) from rdap.identitydigital.services and 209 ms for .org (40) from rdap.publicinterestregistry.org, timed from our server. None of the 490 requests got a 429.

The code#

Is a domain free? Ask the registry of its TLD over RDAPpython
import json, re, time, urllib.error, urllib.request

HEADERS = {"User-Agent": "rdap-check/1.0 (you@example.com)", "Accept": "application/rdap+json"}
LABEL = re.compile(r"[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?")   # letters, digits and inner hyphens, 1 to 63 long
SERVERS = {}                                                 # tld -> RDAP base URL, from IANA
LAST = {}                                                    # RDAP host -> time of our last request to it


def rdap_server(tld):
    """The RDAP base URL that IANA lists for a TLD, or None when the TLD has no RDAP service."""
    if not SERVERS:
        req = urllib.request.Request("https://data.iana.org/rdap/dns.json", headers=HEADERS)
        for tlds, urls in json.load(urllib.request.urlopen(req, timeout=30))["services"]:
            for t in tlds:
                SERVERS[t] = next((u for u in urls if u.startswith("https:")), urls[0])
    return SERVERS.get(tld)


def lookup(domain, pause=1.0):
    """(answer, why, record): answer is 'taken', 'free' or 'unknown'; record is the RDAP answer of a taken name."""
    name, _, tld = domain.strip().lower().rstrip(".").rpartition(".")
    if not LABEL.fullmatch(name):
        return "unknown", "not one valid label before the TLD", None
    base = rdap_server(tld)
    if not base:
        return "unknown", f"no RDAP service for .{tld}", None
    host = base.split("/")[2]                                # .com and .net share one host: pace by host
    wait = LAST.get(host, 0) + pause - time.monotonic()      # be polite: one request per `pause` s per host
    if wait > 0:
        time.sleep(wait)
    LAST[host] = time.monotonic()
    req = urllib.request.Request(f"{base.rstrip('/')}/domain/{name}.{tld}", headers=HEADERS)
    try:
        with urllib.request.urlopen(req, timeout=15) as r:
            record = json.load(r)
        if record.get("ldhName", "").lower() == f"{name}.{tld}":
            return "taken", "registered", record
        return "unknown", "the answer is about another name", None
    except urllib.error.HTTPError as e:
        rdap = "rdap+json" in (e.headers.get("Content-Type") or "")
        if e.code == 404 and rdap:
            return "free", "not registered", None
        if e.code == 429:
            return "unknown", f"rate limited, Retry-After {e.headers.get('Retry-After', 'not given')}", None
        return "unknown", f"HTTP {e.code}" + ("" if rdap else " that is not an RDAP answer"), None
    except (OSError, ValueError) as e:                        # timeouts, refused connections, broken JSON
        return "unknown", type(e).__name__, None


def available(domain):
    """'taken', 'free' or 'unknown'. Free means the registry has no record of it; unknown is never counted as free."""
    return lookup(domain)[0]


def dates(record):
    """Registration and expiry dates of a taken name, from the RDAP events."""
    ev = {e["eventAction"]: e["eventDate"][:10] for e in record.get("events", [])}
    return ev.get("registration"), ev.get("expiration")
Run itpython
for d in ["python.org", "voiddo.com", "zq7xvoid-sample.com", "example.dev", "news.io", "-abcd.com"]:
    print(d, available(d))
answer, why, record = lookup("python.org")
print(answer, dates(record), record["status"])

It printed taken for python.org and voiddo.com, free for a made-up .com name and for example.dev, unknown for news.io (no RDAP server) and for -abcd.com (not a valid name). Then python.org's dates, registered 1995-03-27 and expiring 2033-03-28, and its status, client transfer prohibited.

Taken, free and unknown#

  • Taken: a 200 whose ldhName is the name asked. Upper case and a final dot make no difference: GOOGLE.COM and google.com. both came back taken.
  • Free: a 404 that is an RDAP answer, with the content type application/rdap+json. Do not insist on a JSON body: the 404s from rdap.verisign.com came with an empty one.
  • Unknown: everything else. A 429 (with its Retry-After), any other status, a timeout, a TLD without an RDAP server, a name that is not one valid label before the TLD. Unknown is never counted as free.

The traps#

  1. A registered name looks free at the wrong server. google.net asked at the .com path of rdap.verisign.com got a 404; at the .net path of the same host, a 200. claude.ai asked at the .org server got a 404, and so did wikipedia.org at the .ai server. Take the server from IANA's file, for the TLD of the name you ask about.
  2. A name that cannot be registered looks free. -abcd.com, ab_cd.com and shop.github.com, a name under a registered domain, all got a 404 from the .com server. lookup() checks the name first and returns unknown for these without asking.
  3. A wrong path can give a 404 that looks like RDAP. Without the /rdap/ part of its address, the .org server answered 404 with the RDAP content type and an empty body, just like a free name. The .dev server answered a plain-text 404 of 18 bytes, and the .com server a 400. The content-type check catches the second, not the first, so use the base address exactly as IANA lists it.
  4. Free means not registered, not that you can buy it. The 404 for example.dev carries an error code, "example.dev not found", the conformance and language tags and the registry's terms of use, and nothing about reserved or premium names. It was the same as the 404 for a random string once the name was masked. cloud.dev, house.dev, music.dev and cloud.app came back free the same way, and we did not try to buy them. Check a short word at a registrar before you plan on it.
  5. No server, no answer. For .io, .co and .me the IANA file has no entry, and lookup() says unknown with that reason. A list that mixes extensions will have holes; count them, do not drop them.
  6. Rate limits did not show up, but plan for them. 0 of 490 requests got a 429 at about one a second per extension. lookup() turns a 429 into unknown with the Retry-After value; our run would have waited that long once and stopped asking that server at the second.

Taken names carry their dates#

dates() reads registration and expiry from the events of a taken name. Among the 150 four-letter .com names, the median year of registration was 2005: 11 were registered before 2000 and 2 in 2020 or later. 2 showed an expiry date at most 30 days after our run. That is the end of the current term, not a sign that the name will come free.

Many names at once#

For long lists, our Domain Availability Checker on Apify does the asking. Paste up to 10,000 domains or links in one run and get one row per domain: available or registered, registrar, registration and expiry dates and days to expiry, from the registry that runs the TLD. Maximum results defaults to 1,000 rows, so set it to 10,000 for a list that long. A name under a registered domain comes back as subdomain, and an extension without an open RDAP service as unknown with the reason, never as free. It is billed per result. How to set it up, step by step: domain availability export.

written