title: C# Get computer name from IP
body: <p>I'm using Xamarin Studio to develop to iOS and I need a couple of functions to get the Computer Name from the IP and vice-versa</p>
  
  <p>I've tried this code to get the machine name from IP</p>
  
  <pre><code>string machineName = string.Empty;
  try
  {
      IPHostEntry hostEntry = Dns.GetHostEntry(ipAdress);
  
      machineName = hostEntry.HostName;
  }
  catch (Exception ex)
  {
      // Machine not found...
  }
  return machineName;
  </code></pre>
  
  <p>But I keep getting the machine IP Address, so it's useless because I input the IP Address and get the IP Address.</p>
  
  <p>I've tried something alike to get the IP Address from the HostName I always get the exception "Unable to resolve hostname <em>HITMAN-DESKTOP</em>" being the <em>HITMAN-DESKTOP</em> my remote machine that is accessible from any point in the network and online during the tests.</p>
  
  <p>Any ideas?</p>