Jose Saiz

Jose Saiz

  • 1.5k
  • 260
  • 102.9k

Help please {No Such host is known} error

Feb 26 2021 1:01 AM
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 
  1. 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.
 
 

Answers (2)