Question

I'm having a scenario wherein I need either the machine name of the client who is accessing my website or his actual IP address.

I did a lot of searching and browsing and I found that most of the responses suggested me to use Request.ServerVariables["REMOTE_ADDR"] or Request.UserHostAddress. But this is not what I'm looking for. Both of these are returning the server's IP address instead of the actual IP address of the client who is accessing my website.

I found this particular article that shows how to get the IP address of the client using some external web service call. I tried it but it didn't work.

I even found many responses saying that getting the actual IP address isn't possible and getting the machine name of the client is also not possible if the client is accessing from outside the intranet.

Can someone please confirm this and correct me if I'm wrong? Thank you. :)

Was it helpful?

Solution

try this site

http://www.geekpedia.com/tutorial45_How-to-get-IP-address-of-client.html

here they have given a way to do it may be it will help

OTHER TIPS

You can't get the IP if the machine is behind a proxy. What's your exact use case?

Are you using a proxy or reverse-proxy of some kind? REMOTE_ADDR should indeed be the client source ip.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top