0

I know IP addresses of our production servers which are in a web farm. I want to send httpwebrequest to specific server. For example, I want the request www.example.com to hit the IP 10.102.180.21 and measure response time. And I ll continue this, for remaining servers as well.

    HttpWebRequest requs = (HttpWebRequest)WebRequest.Create("http://10.102.180.21");
        requs.Host= "www.exmaple.com";

I did the above code after some research. Is it correct?. After creating request, I want to verify, what server my request is connected to . Please guide me. Thanks

ARB
  • 285
  • 1
  • 6
  • 17

1 Answers1

0

Edit the hosts file on your server to override what ip a domain resolves to.

Put this line in your hosts file:

10.102.180.21 www.example.com

On windows your hosts file is located here:

c:\windows\system32\drivers\etc\hosts

On linux and mac your hosts file is located here:

/etc/hosts
moander
  • 2,080
  • 2
  • 19
  • 13