You can use either of these:
- HttpContext.Current.Server.MachineName
- HttpContext.Current.Request.ServerVariables[‘LOCAL_ADDR’]
The first one should return the name of the machine, the second returns the local ip address.
Note that name of the machine could be different than host, since your site could be using host headers
Share with