code: def run(self):
          
  
          logging.debug("Querying server {0}".format(self.server['ip']))
  
          try:
              # Create a DNS resolver query
              rsvr = dns.resolver.Resolver()
              rsvr.nameservers = [self.server['ip']]
              rsvr.lifetime = 5
              rsvr.timeout = 5
  
              qry = rsvr.query(self.domain, self.recType)
  
              # Get the results, sort for consistancy
              results = sorted([r.to_text() for r in qry])
              success = True
          # Handle all the various exceptions
          except dns.resolver.NXDOMAIN:
              success = False
              results = ['NXDOMAIN']
          except dns.resolver.NoNameservers:
              success = False
              results = ['No Nameservers']
          except dns.resolver.NoAnswer:
              success = False
              results = ['No Answer']
          except dns.resolver.Timeout:
              success = False
              results = ['Server Timeout']
  
          # Save the results
          self.result = {
              'server': self.server,
              'results': results,
              'success': success
          }
docs: Do a single DNS query against a server