title: Unable to connect to linux machine using hostname(Able to connect using IpAddress using shrapSSH and C sharp)
body: <p>I am trying to connect to linux remote machine using hostname it fails(but i am able to connect using Ipaddress) using Shrp SSH as interface . here is my sample code </p>
  
  <pre><code>public void ConnectToLinuxParttion()
  {
      string username = "aaaa";
      string password = "aaaa";
      string partionName = Lmac;
  
      try
      {
          SshExec exec = new SshExec(partionName,username,password);
          exec.Connect();
          Console.WriteLine("OK");
          exec.Close();
      }
      catch (Exception ex)
      {
          Console.WriteLine("The Reason for Not Connecting is " + ex.ToString());
      }
  }
  </code></pre>
  
  <p>the errors i am getting are:</p>
  
  <blockquote>
    <p>The Reason for Not Connecting is Tamir.SharpSsh.jsch.JSchException: 
     System.Net.Sockets.SocketException (0x80004005): The requested name is
     valid and was found in the database, but it does not have the correct associated data being resolved for    at
    System.Net.Dns.InternalGetHostByName(String
    hostName, Boolean includeIPv6)    at</p>
    
    <p>System.Net.Dns.GetHostByName(String
    hostName)    at</p>
    
    <p>Tamir.SharpSsh.java.net.Socket..ctor(String
    host, Int32 port)    at</p>
    
    <p>Tamir.SharpSsh.jsch.Util.createSocket(String
    host, Int32 port, Int32 timeout)    at</p>
    
    <p>Tamir.SharpSsh.jsch.Session.connect(Int32
    connectTimeout)    at</p>
    
    <p>Tamir.SharpSsh.jsch.Session.connect() at</p>
    
    <p>Tamir.SharpSsh.SshBase.ConnectSession(Int32 tcpPort)    at</p>
    
    <p>Tamir.SharpSsh.SshBase.Connect(Int32 tcpPort)    at</p>
    
    <p>Tamir.SharpSsh.SshBase.Connect()</p>
  </blockquote>
  
  <p>Please help regarding this Thanks in acvance</p>
  
  <p>It worked fine when we installed Bonjour Service on our machines and  AVahi on Linux machines add .Local  partionName   they will work only in same subnet address else it wont.</p>