def get_txt_dnspython(name):
    try:
      a = dns.resolver.query(name, dns.rdatatype.TXT,raise_on_no_answer=False)
      for r in a.response.answer:
          if r.rdtype == dns.rdatatype.TXT:
              return b"".join(r.items[0].strings)
    except dns.resolver.NXDOMAIN: pass
    return None
Return a TXT record associated with a DNS name.
dataset/ETHPy150Open Flolagale/mailin/python/dkim/dnsplug.py/get_txt_dnspython