Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

add faq note for localhost.localstack.cloud not resolving on Windows #1749

Open
HarshCasper wants to merge 1 commit into main
base: main
Choose a base branch
Loading
from windows-faq

Conversation

@HarshCasper
Copy link
Member

@HarshCasper HarshCasper commented May 1, 2025

No description provided.

Copy link

github-actions bot commented May 1, 2025
edited
Loading

🎊 PR Preview has been successfully built and deployed to https://localstack-docs-preview-pr-1749.surge.sh 🎊


### Why is `localhost.localstack.cloud` not resolving on Windows with WSL, and how do I fix it?

We’ve seen multiple reports where requests to `localhost.localstack.cloud` fail specifically when running on **Windows with WSL (Windows Subsystem for Linux)**.
Copy link
Member

@bartsdev bartsdev May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I'd call out that we had multiple reports of this, our customers don't need to know that.
Here's my suggested update to the whole file.

Why can't I connect to localhost.localstack.cloud when using WSL on Windows?

Symptom:

You might encounter issues where localhost.localstack.cloud (or other *.localhost.localstack.cloud subdomains) do not resolve correctly when you are using LocalStack on Windows with the Windows Subsystem for Linux (WSL). This can manifest as tools like curl inside WSL, or even your browser on Windows, failing to connect to services exposed by LocalStack via these domains.

Cause:

This is typically a DNS resolution problem. Your WSL distribution and/or your Windows host system may not be configured to resolve localhost.localstack.cloud (and its subdomains) to the loopback IP address (127.0.0.1).

Solution:

To ensure that localhost.localstack.cloud resolves correctly in both your WSL environment and on your Windows host, you'll need to manually update the hosts file in both locations.

  1. Update the hosts file in your WSL distribution:

    • Open your WSL terminal (e.g., Ubuntu, Debian).
    • Edit the /etc/hosts file using a text editor with root privileges. For example, with nano:
      sudo nano /etc/hosts
    • Add the following line to the file:
      127.0.0.1 localhost.localstack.cloud
      
    • If you use other subdomains like s3.localhost.localstack.cloud, you can add them on the same line or as separate entries pointing to 127.0.0.1:
      127.0.0.1 localhost.localstack.cloud s3.localhost.localstack.cloud
      
    • Save the file and exit the editor (in nano, press Ctrl+X, then Y, then Enter).
  2. Update the hosts file on your Windows system:

    • You will need Administrator privileges to edit the Windows hosts file.
    • Open Notepad (or your preferred text editor) as an Administrator. (Search for Notepad, right-click, "Run as administrator").
    • In the editor, open the following file: C:\Windows\System32\drivers\etc\hosts
    • Add the same line(s) you added to your WSL hosts file:
      127.0.0.1 localhost.localstack.cloud
      # Add other subdomains if needed, e.g.:
      # 127.0.0.1 s3.localhost.localstack.cloud
      # 127.0.0.1 my-bucket.s3.localhost.localstack.cloud
      
    • Save the file.
  3. Flush the DNS cache on Windows:

    • Open Command Prompt or PowerShell as an Administrator.
    • Run the following command:
      ipconfig /flushdns

After completing these steps, your system should correctly resolve localhost.localstack.cloud (and any other specified subdomains) to 127.0.0.1, allowing your applications in both WSL and Windows to connect to LocalStack services.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@plafond plafond Awaiting requested review from plafond

@quetzalliwrites quetzalliwrites Awaiting requested review from quetzalliwrites

1 more reviewer

@bartsdev bartsdev bartsdev left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /