-
Notifications
You must be signed in to change notification settings - Fork 827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to resolve domain names on WSL #5584
Comments
What is the contents of /etc/resolv.conf? |
I faced similar issue. As mentioned by @benhillis the content of I changed it to:
Now I was able to ping different websites. |
Just wanted to boost this -- I've reproduced/experienced this problem on Insider Build 20190.1000 (fast ring), Ubuntu 18.04. I utilized the same fix -- adding |
I have the |
I suspect this is a duplicate of #5806 |
If you modified, moved or compressed the temp folder, look at #5437 for the solution |
Hardcoding /etc/resolv.conf is not a great solution if you use VPN tunnels or move around to different networks. I can't reach 8.8.8.8 when I'm on VPN or on my internal corporate network. I want resolv.conf to point to the windows resolution so that VPN / internal networks would transparently to the WSL image. I don't do this currently as #5806 causes incorrect DNS responses when using the WSL DNS proxy. DNS search paths are not propagated #701 and VPN changes are not either #1350. |
Thanks for confirming my suspicions @timriker! (And understanding that hardcoding nameservers in |
I've searched dozens of tickets and this one appears to be the most closely aligned with the issues I've seen and I have additional information that may (or more likely, may not) be helpful. I installed WSL2 on a clean machine. Immediately upon starting up I encountered the same issue as many others with no DNS resolution. This is easily, although awkwardly, solved by preventing resolv.conf auto-generation and hard coding an external DNS server. This allows normal internet operations on the WSL2 instance. The core problem, at least in my case, isn't that there isn't a DNS resolver at the WSL2 host adapter address (there may or may not be; no idea), it's that the WSL2 instance cannot communicate with the host Windows 10 instance using the host's WSL adapter IP address. I have opened the Windows 10 Firewall to ICMP from anywhere for testing and have a TCP server running there that can be reached on port 6001 (Firewall also opened to allow connections to that port). The WSL2 instance CAN reach the windows machine using the network IP assigned by my router (192.168.0.xxx) but it cannot reach the host using the WSL adapter IP. Neither ping nor a Interestingly, I can ping and connect to that IP from the host itself so the network adapter is activated and seemingly reachable. One might think firewall, but nothing changes even with the firewall disabled. I am working around this but it does make tools that rely on this connection (VS Code and more importantly for me, The Intellij IDEA WSL2 integration) non-functional. |
I run into this issue just now, but figured out that it was related to this Cisco anyConnect VPN issue https://community.cisco.com/t5/vpn/anyconnect-wsl-2-windows-substem-for-linux/td-p/4179888 |
This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request. Thank you! |
Nslookup can resolve the domain but ping can't, It was working a day before (I think there was a windows update), I turned off my computer, after that it stopped working. (I have tried adding a new WSL (different version of ubuntu) it still does it on a fresh install as well.
In the screen below you can see that I can ping the actual IP that was resolved by
nslookup
forgoogle.com
butping (and any other app on the system is unable to resolve the domain names)
The text was updated successfully, but these errors were encountered: