Cannot connect to internet or even ping from "Bash on ubuntu on Windows"

5,955

Solution 1

The problem you're having is because Microsoft still develops bash on Windows, and the network capabilities on Windows 10 are not fully implemented yet.

Though it was widely believed that it is implemented to more or less usable state, so of course there's a bug report. You can track the progress of solving the bug here, be sure to read comments of sunlimit user, they is a Microsoft employee, and explains the problem.

I'd recommend to make some kind of activity there — the more peoples interested, the faster it get fixed.

Solution 2

To solve the "unable to resolve host", do this

sudo rm /etc/hosts

close the window and run bash again to regenerate hosts file.

Share:
5,955

Related videos on Youtube

Girish Sunkara
Author by

Girish Sunkara

Updated on September 18, 2022

Comments

  • Girish Sunkara
    Girish Sunkara over 1 year

    Unable to ping or download any packages. Below are the contents of resolv.conf

    root@LAPTOP-UQSGIHE1:/mnt/c/# cat /etc/resolv.conf
    #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
    nameserver 192.168.100.1    
    nameserver 202.148.200.3    
    nameserver 202.148.202.4
    
    oracle@LAPTOP-UQSGIHE1:/mnt/c/Windows/System32$ sudo ifconfig
    sudo: unable to resolve host LAPTOP-UQSGIHE1
    Warning: cannot open /proc
    /net/dev (No such file or directory). Limited output.
    
    • Hi-Angel
      Hi-Angel almost 8 years
      What does ip addr command show? And please, use markdown to format the question.
    • Girish Sunkara
      Girish Sunkara almost 8 years
      oracle@LAPTOP-UQSGIHE1:~$ ip addr SO_SNDBUF: Invalid argument
    • Hi-Angel
      Hi-Angel almost 8 years
      Hmm… Does ifconfig throws errors too? And btw, it's important information which you better off include into the question than leave in comments.
    • Girish Sunkara
      Girish Sunkara almost 8 years
      oracle@LAPTOP-UQSGIHE1:/mnt/c/Windows/System32$ sudo ifconfig sudo: unable to resolve host LAPTOP-UQSGIHE1 Warning: cannot open /proc/net/dev (No such file or directory). Limited output.
  • Girish Sunkara
    Girish Sunkara almost 8 years
    It is not working for me. I removed the /etc/hosts and reopened bash.
  • Nathan Lutterman
    Nathan Lutterman over 7 years
    Here's the link for voting for the issue directly on the Windows Developer Feedback page: wpdev.uservoice.com/forums/…