WSL Curl doesn't return anything

What issue or error are you experiencing?

curl command on Windows Subsystem for Windows (WSL) isn’t returning anything

What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc


System Details

  • Local Version: latest

  • Operating System (OS) and OS version: Windows 11 Pro


curl -s http://discovery-centre-dev.local | head
curl -s https://discoverycentre.maltsystems.co.uk | head

In the above, the first curl command is querying the Local WP instance and returns nothing. The second is querying a copy of the site on a more traditional Ubuntu WordPress server and returns the HTML as expected.

Any ideas?

Try curl -v without -s and check the exit code; that will show whether it is DNS, connection refused, or an empty response. If it cannot connect, the local hostname may be resolving to WSL’s own loopback rather than the Windows host. Local’s router runs on Windows, so WSL2 often needs an /etc/hosts entry pointing the site hostname at the Windows host IP, or you can test using that IP directly. Also confirm no proxy environment variable is being applied to that hostname.