title: C# Error in SFTP connection. Exception: System.Net.Sockets.SocketException (11001): No such host is known
body: <p>I have written a SFTP connection, which is connecting to a secure domain host (MBox location) in .NET Core:</p>
  
  <pre><code>IPHostEntry ip = Dns.GetHostEntry(Host);
  
  using (SftpClient client = new SftpClient(ip.ToString(), Port, User, Password))
  {
      //connect to client
      client.Connect();
      var files = client.ListDirectory(PathToRead).ToList();
      ......
      //wait for downloads to finish
      await Task.WhenAll(tasks);
  
      // disconnect the client by closing connection
      client.Disconnect();
  }
  </code></pre>
  
  <p>which is hosted in Azure App service with subscription and Azure AD configured as per my client's domain. When I am running the code I am seeing the following error:</p>
  
  <blockquote>
    <p>Error in FTP connection. Exception: System.Net.Sockets.SocketException (11001): No such host is known</p>
  </blockquote>
  
  <p>Can you please help.</p>