def query_dns(cls, domains, records):
        """
        Query DNS records for host.
        :param domains: Iterable of domains to get DNS Records for
        :param records: Iterable of DNS records to get from domain.
        """
        results = {k: set() for k in records}
        for record in records:
            for domain in domains:
                try:
                    answers = cls.resolver.query(domain, record)
                    for answer in answers:
                        # Add value to record type
                        results.get(record).add(answer)
                except (resolver.NoAnswer, resolver.NXDOMAIN, resolver.NoNameservers):
                    # Type of record doesn't fit domain or no answer from ns
                    continue

        return {k: v for k, v in results.items() if v}
def query_dns ( cls , domains , records ) : results = { k : set ( ) for k in records } for record in records : for domain in domains : try : answers = cls . resolver . query ( domain , record ) for answer in answers : results . get ( record ) . add ( answer ) except ( resolver . NoAnswer , resolver . NXDOMAIN , resolver . NoNameservers ) : continue return { k : v for k , v in results . items ( ) if v }
Query DNS records for host.
        :param domains: Iterable of domains to get DNS Records for
        :param records: Iterable of DNS records to get from domain.