title: Host Name is sometimes empty
body: <p>In one of my applications (ASP.NET/VB.NET), I need to read the Client Machine Name. Based on the Client Machine we trigger a Point of Sale payment device to accept the payment. On each of these systems we have a stand alone software installed which communicates to the bank using HTTP requests. I am using the following .NET  code to read the Client Computer Name.</p>
  
  <pre><code>Dim name As String = String.Empty
  Dim hostEntry = Dns.GetHostEntry(HttpContext.Current.Request.UserHostAddress)
  If hostEntry.HostName.Contains(".") Then
      name = hostEntry.HostName.Substring(0, hostEntry.HostName.IndexOf("."))
  Else
      name = hostEntry.HostName.Trim
  End If
  </code></pre>
  
  <p>In the development environment, all our systems are in a domain ("xyz.com") and we don't have any issues. In the customer location they don't have a domain name setup. My above logic works well in some of the systems in the client environment and is able to make payments but in most of the systems our logic fails and is not able to read the host name. Any help will be appreciated.</p>