Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我想计算匹配一个简单模式的主机数量。例如:
host1.example.com host2.example.com ... host42.example.com
我事先不知道其中有 42 个。我想做的是:
answers = dns.resolver.query('host*.example.com', 'A')
然后能够获得计数的答案长度或迭代实际主机名的答案。
谢谢,
格伦