If you installed Bash in Windows 10 and the network does not work for you, e.g. you cannot connect to some host via ssh, here is a quick fix for you which will help you to resolve this issue. See the instructions below.
Networking in bash may not work due to improper DNS resolving in the bash session. It is probably a bug in the Linux subsystem, since it is very new component of Windows 10.
To fix non-working network in Bash console in Windows 10, just add the correct DNS server to the Linux component of Windows 10. Here's how.
- Open Bash. You can launch it right from the Start menu or using the method described HERE.
- At the bash console, execute the following command:
echo nameserver 8.8.8.8 > /etc/resolv.conf
Replace the portion 8.8.8.8 with the actual address of your DNS server. If you don't know your DNS server address, you can definitely use 8.8.8.8, which is the public DNS server provided by Google. It usually always works.
See the following screenshot:
Once this is done, your bash network should be up and running. Here's Winaero.com opened in the console browser "Links" on the fixed bash instance:
That's it.
Support us
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:
Thanks! I had this happen to me when using curl.
Don’t mention it. Happy to hear that it works for you.
I’m sure there’s a way to do this in Windows correct?
I am sorry, I didn’t get what do you mean.
still no connection :(
thanks for providing the solution it will help us to fix the problem !!