Trying to get the local machine name for an Azure hosted ASP application.
Request.ServerVariables["HOST_NAME"]
returns 127.0.0.1 as does HOST_ADDRESS
In fact I can't find anything in Request.Server variables that reflects the local hostname.
Dns.GetHostEntry(Request.UserHostAddress).HostName
will not work as this is a server side lookup, so all you get is the public gateway name not the actual end-user machine name.
Any ideas?
I am stumped and just feel this should be so simple!??!
As you're potentially behind a load balancer when you deploy to azure try using