WSL icon indicating copy to clipboard operation
WSL copied to clipboard

No internet access after reboot

Open avxkim opened this issue 8 years ago • 68 comments

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?

avxkim avatar Aug 04 '18 16:08 avxkim

Try to add DNS server IP address with: echo 8.8.8.8 > /etc/resolv.conf.

Biswa96 avatar Aug 04 '18 17:08 Biswa96

sudo echo 8.8.8.8 > /etc/resolv.conf

Output:

bash: /etc/resolv.conf: Permission denied

Even with sudo i can't

avxkim avatar Aug 04 '18 17:08 avxkim

@heihachi88 What's the output of ll /etc/resolv.conf and ll /run/resolvconf/resolv.conf ?

onomatopellan avatar Aug 04 '18 18:08 onomatopellan

both files empty... what the hell, yesterday it worked after reboot, approx after 1 hour. Nothing new i installed.

avxkim avatar Aug 04 '18 18:08 avxkim

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.

onomatopellan avatar Aug 04 '18 19:08 onomatopellan

Files didn't exist.

Are you sure it's not 18.04 issue? Are you using 18.04 yourself?

avxkim avatar Aug 04 '18 19:08 avxkim

Yes, I'm using 18.04 but I'm using build 17134. Can't you upgrade your Windows 10?

onomatopellan avatar Aug 04 '18 19:08 onomatopellan

How can i upgrade build? I must switch to beta or something? I just migrated from MacOS (used it last 6 years)

avxkim avatar Aug 04 '18 19:08 avxkim

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

onomatopellan avatar Aug 04 '18 19:08 onomatopellan

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 avatar Aug 05 '18 09:08 avxkim

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?

avxkim avatar Aug 05 '18 12:08 avxkim

You have problems with the network adapter, WSL is not at all .WSL uses WinSocket

MVoz avatar Aug 05 '18 12:08 MVoz

@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.

avxkim avatar Aug 05 '18 12:08 avxkim

@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 avatar Aug 05 '18 12:08 Biswa96

@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.

avxkim avatar Aug 05 '18 12:08 avxkim

2018-08-05_205123

возможно поможет сброс


netsh winsock reset
netsh int ip reset all
netsh winhttp reset proxy
ipconfig /flushdns

reboot

MVoz avatar Aug 05 '18 12:08 MVoz

@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.

JoBrad avatar Aug 06 '18 01:08 JoBrad

@Voskrese is reboot necessary? I'll try it next time it won't resolve.

avxkim avatar Aug 06 '18 01:08 avxkim

@heihachi88 This is a recommendation, once reboot to have entered new settings, I think is not the same and the problem

MVoz avatar Aug 06 '18 09:08 MVoz

@Voskrese tried your changes, even rebooted 🤣 , but still no /etc/resolv.conf just WTF is this.

avxkim avatar Aug 07 '18 09:08 avxkim