简体   繁体   中英

Python DNS Change Server

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 ?

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM