views:

13

answers:

2

I have a couple of servers and a load balancer. I want to show a server name which is currently serving the page.

I am using HttpContext.Current.Request.ServerVariables["SERVER_NAME"] and HttpContext.Current.Request.ServerVariables["LOCAL_ADDR"] but is shows the same data for all servers (load balancer information is shown but not the information about exact server name).

How to get a relevant information?

+2  A: 

Try System.Environment.MachineName.

kbrimington
A: 

Perhaps Server.MachineName does what you are looking for?

CodingInsomnia