Set specific DNS server using dns.resolver (pythondns)

后端 未结 4 1915
孤街浪徒
孤街浪徒 2020-12-03 02:22

I am using dns.resolver from dnspython.

Is it possible to set the IP address of the server to use for queries ?

4条回答
  •  一整个雨季
    2020-12-03 03:15

    You don't specify in your question, but assuming you're using the resolver from dnspython.org, the documentation indicates you want to set the nameservers attribute on the Resolver object.

    Though it may be easier to provide an /etc/resolv.conf-style file to pass to the constructor's filename argument.

提交回复
热议问题