So that I will remember!
When running WSL in a corporate environment, I sometimes an error like the following, where the cli is not able to resolve the IP address correctly. This error is from terraform but I have seen it elsewhere.
╷ │ Error: Failed to query available provider packages │ │ Could not retrieve the list of available versions for provider hashicorp/random: could not connect to registry.terraform.io: failed to request discovery document: Get │ “https://registry.terraform.io/.well-known/terraform.json": dial tcp: lookup registry.terraform.io on 220.127.116.11:53: read udp 18.104.22.168:51522->22.214.171.124:53: i/o timeout
to fix it
Change the DNS Server in /etc/resolv.conf
You will need to do this for every tab you open or you can follow the instructions to set it permanently
Now I know :-)