No internet access after reboot
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?
Try to add DNS server IP address with: echo 8.8.8.8 > /etc/resolv.conf.
sudo echo 8.8.8.8 > /etc/resolv.conf
Output:
bash: /etc/resolv.conf: Permission denied
Even with sudo i can't
@heihachi88 What's the output of ll /etc/resolv.conf and ll /run/resolvconf/resolv.conf ?
both files empty... what the hell, yesterday it worked after reboot, approx after 1 hour. Nothing new i installed.
Empty or file did not exist? I was interested in the file permissions. This is what it looks like:.
onoma@DESKTOP:~$ ll /etc/resolv.conf
lrwxrwxrwx 1 root root 29 May 11 21:15 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
onoma@DESKTOP:~$ ll /run/resolvconf/resolv.conf
-rw-r--r-- 1 root root 147 Aug 4 20:28 /run/resolvconf/resolv.conf
Seems file got corrupted or something. I would uninstall the Ubuntu18.04 app and reinstall it to see if it happens again.
Files didn't exist.
Are you sure it's not 18.04 issue? Are you using 18.04 yourself?
Yes, I'm using 18.04 but I'm using build 17134. Can't you upgrade your Windows 10?
How can i upgrade build? I must switch to beta or something? I just migrated from MacOS (used it last 6 years)
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
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?
Ended it this way:
sudo bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf'
sudo bash -c 'echo "nameserver 8.8.4.4" >> /etc/resolv.conf'
exit
-c parameter was missing from @Biswa96 answer, now my DNS is working, but still, why DOES it happening?
You have problems with the network adapter, WSL is not at all .WSL uses WinSocket
@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.
@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.
@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.

возможно поможет сброс
netsh winsock reset
netsh int ip reset all
netsh winhttp reset proxy
ipconfig /flushdns
reboot
@Voskrese your instructions helped me - thanks!
Weird that this became a problem after upgrading to build 17730. I had no issues with DNS prior to upgrading, and pinging via IP worked fine.
@Voskrese is reboot necessary? I'll try it next time it won't resolve.
@heihachi88 This is a recommendation, once reboot to have entered new settings, I think is not the same and the problem
@Voskrese tried your changes, even rebooted 🤣 , but still no /etc/resolv.conf just WTF is this.