How to Find a Domain's DNS Provider from Its Nameservers in Python
A DEV Community post explains that a domain's DNS provider is identified by its NS records, not its registrar, and that host name patterns such as Cloudflare, Route 53, Azure DNS and NS1 reveal the provider. It notes that bulk lookups can go wrong with www-style hostnames and CNAMEs, which may return another company's nameservers or an SOA from an unrelated zone. The author proposes walking up the labels until reaching a name that owns its own NS records, and checking NXDOMAIN responses. The article then demonstrates a Python script using a free DNS-over-HTTPS endpoint to convert a list of domains into a CSV of nameservers and providers. It also mentions a hosted option via an Apify Actor 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