No such Host is found


I am trying to write some integration test for my dotnet core application using localstack.
When I run it in docker all works fine but when I try to debug some test case I get two issues

  1. No such Host is fond
  2. It my application tries to access local file instead of a file in the bucket
    e.g. I have some file in my test bucket “test” under folder “my-file” but it is trying to access the path
    Please provide me some guidance to correct this.


Hi @Kumar , thanks for reaching out.

To understand what is going on we need a little more information.

  • Can you explain a little more what your application does, specifically how it interacts with AWS/LocalStack?
  • Can you show how you start LocalStack, e.g. Docker Compose, the CLI, regular Docker?
  • Can you explain how your application connects to LocalStack? E.g. your code uses the dotnet AWS SDK and sets the endpoint url to ...?
  • Can you explain what hostname is not found?
  • I am not sure what you mean by your second item. It sounds like an error with your application rather than LocalStack. Could you post the code you are using?

Hi Simon,

Thanks for your reply.
In my application we have some services which read/write some files from specified s3 bucket and at the end put the data in postgres DB.
We are using Docker Compose to start the local stack.
We are using .Net SDK .

Where is my situation:
We have some integration test and this works fine when I run it trough Docker-compose locally or in CI.
But I am facing issue while running/debugging my integration tests in VisualStudio.
To debug it locally I run my services,db through docker-compose and then Open Integration tests solution in VisualStudio and trying to access the the buckets (localStack) which is causing the issue.

For example when I perform _amazonS3.ListObjectsV2Async . I am getting → error: No such host is known. (http://localstack:4566/)

This is solved by using
AwsServiceUrl = “