How can I check the value of a DNS TXT record for a host?

Viewed 14265

I'm looking to verify domain ownership via a script, specifically a Python script, and would like know how to lookup the value of a DNS TXT entry. I know there are services and websites out there for this, but I would like to do it with a script.

4 Answers

Found another way to get list of all TXT records for a domain using dnspython.

import dns.resolver
[dns_record.to_text() for dns_record in dns.resolver.resolve("your-domain-here", "TXT").rrset]
Related