I am using the following code under windows 2016 Standard Server IIS10 - .NET Framework 4.0
Goal to obtain the remote client computer name.
C# Code Behind
Default.aspx.cs
- var RemoteClient_DevineName = System.Net.Dns.GetHostEntry(HttpContext.Current.Request.ServerVariables["REMOTE_HOST"]).HostName;
Result is this error message below
Server Error in '/' Application.
No such host is known
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: No such host is known
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SocketException (0x2af9): No such host is known]
System.Net.Dns.InternalGetHostByAddress(IPAddress address, Boolean includeIPv6) +2943591
System.Net.Dns.GetHostEntry(String hostNameOrAddress) +8625688
Thank you for your help.
2 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jose SaizPosted Feb 26, 2021, 11:49 PM
Sachin SinghPosted Feb 26, 2021, 4:18 AM