Python DNS Change Server

佐手、 提交于 2019-12-14 04:22:51

问题


What is the easiest way of changing the server that is queryed againest when using dnspython Ive been using the following,

dns.resolver.query(hostname,type)

However from the documentation it appears you can only change the file it looks at for its resolver servers.

Any ideas ?


回答1:


Resolver can load configuration either from the Windows registry or from /etc/resolv.conf. If you want to configure dns server manually, don't read system configuration (create it with configure=False) and configure it yourself.

Resolver has the nameservers property which is a list of DNS servers IPs (as strings).



来源:https://stackoverflow.com/questions/16997463/python-dns-change-server

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!