In the sample code for the HttpWebRequest class listed on MSDN:
HttpWebRequest myReq =
(HttpWebRequest)WebRequest.Create("http://www.contoso.com/");
Does not require an IP.
Edit:
As a test, I threw this into a throw away application I have:
HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create("http://domain1.mylocalhost.com/");
HttpWebRequest myReq2 = (HttpWebRequest)WebRequest.Create("http://domain2.mylocalhost.com/");
WebResponse myReqResponse = myReq.GetResponse();
WebResponse myReq2Response = myReq2.GetResponse();
long x = myReqResponse.ContentLength;
long y = myReq2Response.ContentLength;
MessageBox.Show((x == y).ToString());
I have domain1 pointing to a valid site that functions. I have domain2 pointing to a site that delivers an error 500 for all requests. Both are on the same IP. The code above generates a content length of 17320 for myReqResponse and myReq2Response throws an exception delivering up the error 500. An IP address is not necessary and the resolution behind the scenes does not affect its behavior.