且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Python DNS服务器IP地址查询

更新时间:2022-02-23 23:20:16

DNS Python( dnspython )可能会有所帮助.您可以通过以下方式获取DNS服务器地址:

DNS Python (dnspython) might be helpful. You can get the DNS server address with:

 import dns.resolver
 dns_resolver = dns.resolver.Resolver()
 dns_resolver.nameservers[0]