IN RDAP WE TRUST
My cheap way of checking whether a domain is available to be purchased or not. Used by subjack to confirm takeover targets are registrable.
Availability is checked with RDAP first (RFC 9083): the answer is carried by the HTTP status itself — 404 means the domain is not registered, 200 means it is. RDAP servers are discovered from the IANA bootstrap file and cached per TLD, so there is no per-TLD configuration to maintain and no registry response text to fingerprint. TLDs without RDAP fall back to a small whois client (RFC 3912) that discovers authoritative servers via IANA referral and matches a short list of generic "available" responses.
The only dependency is golang.org/x/net (for public suffix data). Requires Go 1.25 or newer.
This package might not be able to check the availability of every possible domain TLD. Always double-check results manually before acting on them.
go get github.com/haccer/available
package main import ( "fmt" "time" "github.com/haccer/available" ) func main() { // Domain uses a 10s timeout. if available.Domain("dreamdomain.io") { fmt.Println("[+] Success!") } // ...or supply your own timeout. available.DomainTimeout("dreamdomain.io", 5*time.Second) // SafeDomain also reports whether the TLD has no usable whois/RDAP // server ("bad" TLD), so you can skip or flag it. avail, badTLD := available.SafeDomain("dreamdomain.io") fmt.Println(avail, badTLD) }
All functions are safe for concurrent use: subdomains are reduced to their registrable domain (eTLD+1) first, and the bootstrap data and whois servers are resolved once per TLD and cached.
The test suite runs entirely offline against local RDAP and whois fixtures:
go test -race ./...