How to Tell if a Domain Is Still Active in Python: NXDOMAIN, NODATA and SERVFAIL
A DEV Community guide explains that checking a domain's A record only shows whether an IP address was returned, not why a lookup failed. It distinguishes NXDOMAIN (the name does not exist in DNS), NODATA (the name exists but has no address record), and SERVFAIL (the domain's DNS is broken), noting that none of these alone confirms registration. The author recommends querying RDAP, the registries' JSON successor to WHOIS, for the domains DNS cannot resolve, while warning that registry terms restrict high-volume automated use. A standard-library Python script using Cloudflare's DNS-over-HTTPS endpoint sorts a domain list into these states, and the post closes with a hosted option built by the author.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in