You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS Version: 10.0.16299 Build: 16299
Ubuntu 18.04 from microsoft store
After PC reboot i open Ubuntu from the start menu, and trying to ping google.kz (using bash), getting an error:
ping: google.kz: Temporary failure in name resolution
Then i check:
cat /etc/resolv.conf
File not found. Not using any VPN, just windows defender and malwarebytes (i've tried to turn it off, but no result). I guess WSL is having trouble launching some auto scripts to create resolv.conf?
@heihachi88 No, I missed the nameserver word. BTW, the resolv.conf file should be automatically created. And it's a symbolic link to /run/resolvconf/resolv.conf. Try to delete that /etc/resolv.conf and exit from wsl.exe. Then rerun wsl.exe and check if that file/symbolic link will automatically created or not.
Biswapriyo Nath (@Biswa96) I can't delete not existing file, both files you mentioned didn't exist, before i manually injected them and exit shell, then relaunch again.
This bug happened to me after installing VirtualBox 6.1.34 - WSL network stopped working.
In order to be able to use VPN beside my home network (the trick with 8.8.8.8 did not work here), I added my router gateway IP as a nameserver to the WSL config:
> netsh interface ip show config "WiFi"
Configuration for interface "WiFi"
DHCP enabled: Yes
IP Address: 192.168.0.106
Subnet Prefix: 192.168.0.0/24 (mask 255.255.255.0)
Default Gateway: 192.168.0.1
Gateway Metric: 0
InterfaceMetric: 50
DNS servers configured through DHCP: 192.168.0.1
Register with which suffix: Primary only
WINS servers configured through DHCP: None
Check if you can ping the router gateway in WSL:
$ ping -c1 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=63 time=2.49 ms
--- 192.168.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 2.487/2.487/2.487/0.000 ms
(optionally) Check the content of /etc/resolv.conf. You will see a description there:
$ cat /etc/resolv.conf
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 172.24.208.1
OS Version: 10.0.16299 Build: 16299 Ubuntu 18.04 from microsoft store
After PC reboot i open Ubuntu from the start menu, and trying to ping google.kz (using bash), getting an error:
ping: google.kz: Temporary failure in name resolution
Then i check:
cat /etc/resolv.conf
File not found. Not using any VPN, just windows defender and malwarebytes (i've tried to turn it off, but no result). I guess WSL is having trouble launching some auto scripts to create resolv.conf?
i was also having same issue, here's how i have fixed
open windows PowerShell as admin and type the following
OS Version: 10.0.16299 Build: 16299 Ubuntu 18.04 from microsoft store
After PC reboot i open Ubuntu from the start menu, and trying to ping google.kz (using bash), getting an error:
ping: google.kz: Temporary failure in name resolution
Then i check:
cat /etc/resolv.conf
File not found. Not using any VPN, just windows defender and malwarebytes (i've tried to turn it off, but no result). I guess WSL is having trouble launching some auto scripts to create resolv.conf?
i was also having same issue, here's how i have fixed
open windows PowerShell as admin and type the following
OS Version: 10.0.16299 Build: 16299 Ubuntu 18.04 from microsoft store
After PC reboot i open Ubuntu from the start menu, and trying to ping google.kz (using bash), getting an error:
ping: google.kz: Temporary failure in name resolution
Then i check:
cat /etc/resolv.conf
File not found. Not using any VPN, just windows defender and malwarebytes (i've tried to turn it off, but no result). I guess WSL is having trouble launching some auto scripts to create resolv.conf?
i was also having same issue, here's how i have fixed open windows PowerShell as admin and type the following
OS Version: 10.0.16299 Build: 16299 Ubuntu 18.04 from microsoft store
After PC reboot i open Ubuntu from the start menu, and trying to ping google.kz (using bash), getting an error:
ping: google.kz: Temporary failure in name resolution
Then i check:
cat /etc/resolv.conf
File not found. Not using any VPN, just windows defender and malwarebytes (i've tried to turn it off, but no result). I guess WSL is having trouble launching some auto scripts to create resolv.conf?
i was also having same issue, here's how i have fixed open windows PowerShell as admin and type the following
netsh advfirewall set allprofiles state off
then press enter restart hope it helps
What are the security risks of doing that?
He shouldn't disable firewall. Instead he should use linux in vm
OS Version: 10.0.16299 Build: 16299 Ubuntu 18.04 from microsoft store
After PC reboot i open Ubuntu from the start menu, and trying to ping google.kz (using bash), getting an error:
ping: google.kz: Temporary failure in name resolution
Then i check:
cat /etc/resolv.conf
File not found. Not using any VPN, just windows defender and malwarebytes (i've tried to turn it off, but no result). I guess WSL is having trouble launching some auto scripts to create resolv.conf?
i was also having same issue, here's how i have fixed open windows PowerShell as admin and type the following
netsh advfirewall set allprofiles state off
then press enter restart hope it helps
What are the security risks of doing that?
There are major security ricks of doing that so it's not recommended but what I would recommend is using using linux on vm. Fell free to contact me for any errors or anything.....
I changed nameserver in /etc/resolv.conf using IP i found from public dns, replacing the usual google dns 8.8.8.8 or 1.1.1.1
No need to restart wsl or computer.
To test the connection can simply run
$ composer diagnose
or
$ sudo apt update
or
ping reknown domain
$ ping google.com
Note: I notice this problem happens sometimes after restarting computer due to windows update (cross finger)
You may still have issues after that so use your Default Gateway (by default 192.168.0.1) in /etc/resolv.conf instead of Google public DNS or any other public DNS.
You may still have issues after that so use your Default Gateway (by default 192.168.0.1) in /etc/resolv.conf instead of Google public DNS or any other public DNS.
I've tried it but it needs to be changed after every restart, however I was able to fix it by:
opening the windows PowerShell as admin and typing the following
netsh advfirewall set allprofiles state off
then pressing enter
restarting
But there are major security ricks of doing that so it's not recommended but what I would recommend is using using linux on vm instead.....
Still with the same issue. Somehow the network between the host and the WSL VM is broken after some actions. With me happens always when I need to connect to any VPN. Just after vpn connection everything works fine. When I disconnect from the vpn wsl vm can't access the internet anymore. I have tried all those commands to restart the windows network stack, wsl vm reboot, restart the wsl system service. Nothing works at all, except a windows reboot. This is really annoying. I hope that you guys figure this out in the near future. I would hate to miss the integrated experience of using WSL (and turn to an VM) because of this...
Hi folks, we have put out a new update that aims to address networking issues in WSL. In your .wslconfig file you can set experimental.networkingMode=mirrored, as well as some other key settings that should improve your network compatibility, and add support for IPv6! Please try them out and let us know what you think.
Please note: You need to be on a Windows Insiders version to use the new networking settings (Any channel of Windows Insiders will do, including release preview). If you see the "These are not supported" messages it means that your current Windows version doesn't have support, and you will need to upgrade. These features will eventually be coming to Windows 11 22H2.
Please see megathread for DNS issues in WSL: #8365
Activity
Biswa96 commentedon Aug 4, 2018
Try to add DNS server IP address with:
echo 8.8.8.8 > /etc/resolv.conf.avxkim commentedon Aug 4, 2018
sudo echo 8.8.8.8 > /etc/resolv.confOutput:
bash: /etc/resolv.conf: Permission deniedEven with sudo i can't
onomatopellan commentedon Aug 4, 2018
@heihachi88 What's the output of
ll /etc/resolv.confandll /run/resolvconf/resolv.conf?avxkim commentedon Aug 4, 2018
both files empty... what the hell, yesterday it worked after reboot, approx after 1 hour. Nothing new i installed.
onomatopellan commentedon Aug 4, 2018
Empty or file did not exist? I was interested in the file permissions. This is what it looks like:.
Seems file got corrupted or something. I would uninstall the Ubuntu18.04 app and reinstall it to see if it happens again.
avxkim commentedon Aug 4, 2018
Files didn't exist.
Are you sure it's not 18.04 issue? Are you using 18.04 yourself?
onomatopellan commentedon Aug 4, 2018
Yes, I'm using 18.04 but I'm using build 17134. Can't you upgrade your Windows 10?
avxkim commentedon Aug 4, 2018
How can i upgrade build? I must switch to beta or something? I just migrated from MacOS (used it last 6 years)
onomatopellan commentedon Aug 4, 2018
If it's your computer this should work
https://support.microsoft.com/en-us/help/4027667/windows-update-windows-10
If it doesn't appear on Windows Update you can also use the Updater Assistant or create a installation media:
https://www.microsoft.com/en-us/software-download/windows10
avxkim commentedon Aug 5, 2018
Updated to 1803, same picture. After sleep / reboot, no resolv.conf, i even reinstalled Ubuntu 18.04
How to manually run that resolv script in WSL?
avxkim commentedon Aug 5, 2018
Ended it this way:
-c parameter was missing from Biswapriyo Nath (@Biswa96) answer, now my DNS is working, but still, why DOES it happening?
MVoz commentedon Aug 5, 2018
You have problems with the network adapter, WSL is not at all .WSL uses WinSocket
avxkim commentedon Aug 5, 2018
voskrese if i had a problem with the network adapter, then in windows i would have the same problem, but on Windows i have no issues related to DNS.
Biswa96 commentedon Aug 5, 2018
@heihachi88 No, I missed the nameserver word. BTW, the resolv.conf file should be automatically created. And it's a symbolic link to
/run/resolvconf/resolv.conf. Try to delete that/etc/resolv.confand exit from wsl.exe. Then rerun wsl.exe and check if that file/symbolic link will automatically created or not.avxkim commentedon Aug 5, 2018
Biswapriyo Nath (@Biswa96) I can't delete not existing file, both files you mentioned didn't exist, before i manually injected them and
exitshell, then relaunch again.40 remaining items
YevheniiPokhvalii commentedon May 28, 2022
This bug happened to me after installing VirtualBox 6.1.34 - WSL network stopped working.
In order to be able to use VPN beside my home network (the trick with 8.8.8.8 did not work here), I added my router gateway IP as a nameserver to the WSL config:
Check if you can ping the router gateway in WSL:
(optionally) Check the content of
/etc/resolv.conf. You will see a description there:Create
/etc/wsl.confin WSL:In Powershell:
In WSL:
Works even after the system reboot, no
chattris required.However, the reason why this issue happened is still unclear.
VarunBanka commentedon Jul 12, 2022
i was also having same issue, here's how i have fixed
open windows PowerShell as admin and type the following
netsh advfirewall set allprofiles state off
then press enter
restart
hope it helps
VarunBanka commentedon Jul 12, 2022
i was also having same issue, here's how i have fixed
open windows PowerShell as admin and type the following
netsh advfirewall set allprofiles state off
then press enter
restart
hope it helps
jikuja commentedon Jul 13, 2022
What are the security risks of doing that?
jjcf89 commentedon Jul 14, 2022
Looks like it's disabling your windows firewall. Wouldn't recommend
VarunBanka commentedon Jul 14, 2022
He shouldn't disable firewall. Instead he should use linux in vm
VarunBanka commentedon Jul 14, 2022
There are major security ricks of doing that so it's not recommended but what I would recommend is using using linux on vm. Fell free to contact me for any errors or anything.....
bayangan commentedon Nov 10, 2022
I changed nameserver in /etc/resolv.conf using IP i found from public dns, replacing the usual google dns 8.8.8.8 or 1.1.1.1
No need to restart wsl or computer.
To test the connection can simply run
$ composer diagnose
or
$ sudo apt update
or
ping reknown domain
$ ping google.com
Note: I notice this problem happens sometimes after restarting computer due to windows update (cross finger)
YevheniiPokhvalii commentedon Nov 11, 2022
bayangan
You may still have issues after that so use your Default Gateway (by default 192.168.0.1) in
/etc/resolv.confinstead of Google public DNS or any other public DNS.VarunBanka commentedon Nov 13, 2022
I've tried it but it needs to be changed after every restart, however I was able to fix it by:
opening the windows PowerShell as admin and typing the following
netsh advfirewall set allprofiles state off
then pressing enter
restarting
But there are major security ricks of doing that so it's not recommended but what I would recommend is using using linux on vm instead.....
CaretakerBlayze commentedon Aug 11, 2023
Nothing helped. I deleted wsl and now i can't even open google. I just don't have internet connection. Please help
bernardosts commentedon Aug 25, 2023
Still with the same issue. Somehow the network between the host and the WSL VM is broken after some actions. With me happens always when I need to connect to any VPN. Just after vpn connection everything works fine. When I disconnect from the vpn wsl vm can't access the internet anymore. I have tried all those commands to restart the windows network stack, wsl vm reboot, restart the wsl system service. Nothing works at all, except a windows reboot. This is really annoying. I hope that you guys figure this out in the near future. I would hate to miss the integrated experience of using WSL (and turn to an VM) because of this...
craigloewen-msft commentedon Sep 19, 2023
Hi folks, we have put out a new update that aims to address networking issues in WSL. In your
.wslconfigfile you can setexperimental.networkingMode=mirrored, as well as some other key settings that should improve your network compatibility, and add support for IPv6! Please try them out and let us know what you think.More info on this release and the changes can be found here in the blog post.
Please note: You need to be on a Windows Insiders version to use the new networking settings (Any channel of Windows Insiders will do, including release preview). If you see the "These are not supported" messages it means that your current Windows version doesn't have support, and you will need to upgrade. These features will eventually be coming to Windows 11 22H2.
Please see megathread for DNS issues in WSL: #8365
OneBlue commentedon May 14, 2024
Hi ! Please try the latest networking features that we've added in WSL. Those should greatly improve compatibility with VPN's.
If the issue still remains, please reopen this issue.