2003-03-04

Asyn DNS resolving

"As it can be seen from the Rotor sources, the class responsible for DNS resolutions is called ServicePoint, and the query is done in its method called GetNextIPAddressInfo(). And while it is simple to do DNS queries asynchronously (Dns.BeginResolve() is readily available), it is not so easy to pass the DNS information to HttpWebRequest. So far, I have thought of only one solution not resorting to manual threading: I can parse the request URLs and replace the host name with a dotted-decimal IP address after the DNS resolution is complete (for example, a request to "home.yole.ru/weblog/index.xml" would be rewritten as "80.70.224.68/weblog/index.xml")." [yole's devblog]

I would advise against this. There may be websites setup as a virtual site on the same IP. To distinguish between sites IIS looks at the host name. If the request comes through with an IP it would get directed to the wrong site.

0 Comments:

Post a Comment

<< Home