質問

Using the HttpWebRequest (even when calling the async get method), it can take up to 15 seconds due to DNS resolution:

A Domain Name System (DNS) query may take up to 15 seconds to return or time out.

Is it possible to make this query in advance, so that it wont spend time at it when making the request?

役に立ちましたか?

解決

It is very likely that the DNS resolution in HttpWebRequest is not pluggable. But you can do the resolution yourself and rewrite the URLs to use the resolved IP as the host name. Make sure to set the correct host-header, though, because many websites require it. Also, I believe HTTPS will be harder because certificate validation is based in part on the host name.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top