coyot
coyot

Reputation: 416

How do I use dnspython to query for a host pattern

Let us say that I want to count the number of hosts that match a simple pattern. For example:

host1.example.com host2.example.com ... host42.example.com

where I don't know ahead of time that there are 42 of these. What I would like to do is something like:

answers = dns.resolver.query('host*.example.com', 'A')

and then be able to get the length of answers for the count or iterate over answers for the actual hostnames.

Thanks,

Glenn

Upvotes: 1

Views: 794

Answers (0)

Related Questions