更新时间: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]