如何在 python 中获取区域的 DNS 记录?我正在寻找类似于输出的数据dig
.
一个简单的例子来自https://c0deman.wordpress.com/2014/06/17/find-nameservers-of-domain-name-python/ https://c0deman.wordpress.com/2014/06/17/find-nameservers-of-domain-name-python/:
import dns.resolver
domain = 'google.com'
answers = dns.resolver.resolve(domain,'NS')
for server in answers:
print(server.target)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)