Parsa Noori
Parsa Noori

Reputation: 338

How can we use proxy for connecting to dns server on requests?

Requests doesn't resolve nameservers via proxies argument given to it by default. How can we use make it do that ?

Upvotes: 1

Views: 1024

Answers (1)

Parsa Noori
Parsa Noori

Reputation: 338

Bases on requests documentation:

Using the scheme socks5 causes the DNS resolution to happen on the client, rather than on the proxy server. This is in line with curl, which uses the scheme to decide whether to do the DNS resolution on the client or proxy. If you want to resolve the domains on the proxy server, use socks5h as the scheme.

Hence we have to just set socks5h for the scheme of the proxy given to the proxies argument.

Upvotes: 1

Related Questions