-
Notifications
You must be signed in to change notification settings - Fork 129
add faq note for localhost.localstack.cloud not resolving on Windows #1749
Conversation
🎊 PR Preview has been successfully built and deployed to https://localstack-docs-preview-pr-1749.surge.sh 🎊
There was a problem hiding this comment.
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.
-
Update the
hostsfile in your WSL distribution:- Open your WSL terminal (e.g., Ubuntu, Debian).
- Edit the
/etc/hostsfile using a text editor with root privileges. For example, withnano: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 to127.0.0.1:127.0.0.1 localhost.localstack.cloud s3.localhost.localstack.cloud - Save the file and exit the editor (in
nano, pressCtrl+X, thenY, thenEnter).
-
Update the
hostsfile 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
hostsfile: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.
-
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.
No description provided.