23

I recently upgraded from Ubuntu 12.04 to Ubuntu 14.04. After restarting I have WiFi connected and/or LAN connection with no internet access. I'm using Toshiba Satellite C855D.

$ sudo lshw -C network

  *-network               
       description: Wireless interface
       product: RTL8188CE 802.11b/g/n WiFi Adapter
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: wlan0
       version: 01
       serial: c0:d9:62:8d:39:85
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=rtl8192ce driverversion=3.13.0-24-generic firmware=N/A ip=192.168.0.109 latency=0 link=yes multicast=yes wireless=IEEE 802.11bgn
       resources: irq:16 ioport:3000(size=256) memory:f0200000-f0203fff
  *-network
       description: Ethernet interface
       product: RTL8101E/RTL8102E PCI Express Fast Ethernet controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:06:00.0
       logical name: eth0
       version: 05
       serial: 00:8c:fa:49:e0:4d
       size: 10Mbit/s
       capacity: 100Mbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl_nic/rtl8105e-1.fw latency=0 link=no multicast=yes port=MII speed=10Mbit/s
       resources: irq:41 ioport:2000(size=256) memory:f0104000-f0104fff memory:f0100000-f0103fff

$ ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:8c:fa:49:e0:4d   
          UP BROADCAST MULTICAST  MTU:1500  Metric:1 
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:1000  
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B) 

lo        Link encap:Local Loopback   
          inet addr:127.0.0.1  Mask:255.0.0.0 
          inet6 addr: ::1/128 Scope:Host 
          UP LOOPBACK RUNNING  MTU:65536  Metric:1 
          RX packets:727 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:727 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:0  
          RX bytes:56993 (56.9 KB)  TX bytes:56993 (56.9 KB) 

wlan0     Link encap:Ethernet  HWaddr c0:d9:62:8d:39:85   
          inet addr:192.168.0.109  Bcast:192.168.0.255  Mask:255.255.255.0 
          inet6 addr: fe80::c2d9:62ff:fe8d:3985/64 Scope:Link 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 
          RX packets:1934 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:61 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:1000  

$ ping 8.8.8.8

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 
64 bytes from 8.8.8.8: icmp_seq=1 ttl=47 time=47.2 ms 
64 bytes from 8.8.8.8: icmp_seq=2 ttl=47 time=44.8 ms 
64 bytes from 8.8.8.8: icmp_seq=3 ttl=47 time=43.6 ms 
64 bytes from 8.8.8.8: icmp_seq=4 ttl=47 time=156 ms 

$ ping google.com

ping: unknown host google.com

$ nslookup google.com 8.8.8.8

Server:     8.8.8.8 
Address:    8.8.8.8#53 

Non-authoritative answer: 
Name:   google.com 
Address: 190.167.241.187 
Name:   google.com 
Address: 190.167.241.178 
Name:   google.com 
Address: 190.167.241.163 
Name:   google.com 
Address: 190.167.241.183 
Name:   google.com 
Address: 190.167.241.177 
Name:   google.com 
Address: 190.167.241.172 
Name:   google.com 
Address: 190.167.241.153 
Name:   google.com 
Address: 190.167.241.162 
Name:   google.com 
Address: 190.167.241.167 
Name:   google.com 
Address: 190.167.241.152 
Name:   google.com 
Address: 190.167.241.168 
Name:   google.com 
Address: 190.167.241.182 
Name:   google.com 
Address: 190.167.241.157 
Name:   google.com 
Address: 190.167.241.173 
Name:   google.com 
Address: 190.167.241.148 
Name:   google.com 
Address: 190.167.241.158 

$ cat /etc/resolvconf/resolv.conf.d/head                   

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) 
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN 
nameserver 8.8.8.8 

$ sudo service networking restart

stop: Job failed while stopping 
start: Job is already running: networking 

$ nm-tool

NetworkManager Tool 

State: connected (global) 

- Device: eth0 ----------------------------------------------------------------- 
  Type:              Wired 
  Driver:            r8169 
  State:             unavailable 
  Default:           no 
  HW Address:        00:8C:FA:49:E0:4D 

  Capabilities: 
    Carrier Detect:  yes 
    Speed:           100 Mb/s 

  Wired Properties 
    Carrier:         off 


- Device: wlan0  [Honey Nut Cheerios] ------------------------------------------ 
  Type:              802.11 WiFi 
  Driver:            rtl8192ce 
  State:             connected 
  Default:           yes 
  HW Address:        C0:D9:62:8D:39:85 

  Capabilities: 
    Speed:           18 Mb/s 

  Wireless Properties 
    WEP Encryption:  yes 
    WPA Encryption:  yes 
    WPA2 Encryption: yes 

  Wireless Access Points (* = current AP) 
    *Honey Nut Cheerios: Infra, 00:21:29:EF:11:2D, Freq 2437 MHz, Rate 54 Mb/s, Strength 78 WPA2 
    Claro8AD:        Infra, 00:1A:2B:B0:69:CD, Freq 2462 MHz, Rate 54 Mb/s, Strength 27 WPA2 
    CLAROB5F570:     Infra, 88:25:2C:B5:F5:70, Freq 2412 MHz, Rate 54 Mb/s, Strength 20 WEP 
    WIND30:          Infra, 00:1F:FB:68:E3:6C, Freq 2427 MHz, Rate 54 Mb/s, Strength 37 WPA 
    dd-wrt_vap:      Infra, 02:1C:10:34:41:15, Freq 2437 MHz, Rate 54 Mb/s, Strength 24 WPA 

  IPv4 Settings: 
    Address:         192.168.0.109 
    Prefix:          24 (255.255.255.0) 
    Gateway:         192.168.0.1 

    DNS:             8.8.8.8 
    DNS:             8.8.4.4 
Zanna
  • 70,465
  • Okay, you seem to have a wireless connection. Could you update your question with the output of ping google.com as well? And please use code tags for your output, to improve readability. – Louis Matthijssen Apr 26 '14 at 00:19
  • you can check it out right now I posted it already. All my regards! – user274227 Apr 26 '14 at 00:22
  • That's right, it means your DNS servers are not working. I have added an answer to this question. – Louis Matthijssen Apr 26 '14 at 00:47
  • thank you for your answer but unfortunately it does not work for me. I don't know why. is there something else I could try? – user274227 Apr 26 '14 at 01:41
  • @user274227 To further edit the post, please go through editing-help to know how to properly format your posts. – Aditya Apr 26 '14 at 16:40
  • What is the output of ``cat /etc/resolv.conf`? – Braiam May 03 '14 at 21:10
  • I had this same problem on my upgrade from 12.04 to 14.04. The last answer worked perfect, Thank you sudo apt-get remove --purge resolvconf && sudo apt-get install --reinstall resolvconf –  May 11 '14 at 16:39
  • If you deleted before downloading the packet (as people suggested not to do but I did anyway), this post saved me https://askubuntu.com/questions/557264/removed-resolvconf-cant-install-anymore

    sudo -i wget http://fr.archive.ubuntu.com/ubuntu/pool/main/r/resolvconf/resolvconf_1.69ubuntu1_all.deb dpkg -i resolvconf_1.69ubuntu1_all.deb

    – George Feb 18 '24 at 13:04

4 Answers4

15

I had this same problem on my upgrade from 12.04 to 14.04. The way I fixed it was by complete removal and reinstall of the resolv config. See below

sudo apt-get remove --purge resolvconf && sudo apt-get install --reinstall resolvconf

It appears that your upgrade as my did not properly install your DNS resolver.

Nattgew
  • 2,100
  • Related bug report: https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1308378 – fuenfundachtzig Aug 15 '14 at 19:13
  • 15
    I will suggest not remove anything since apt-get probably not working either to install it back! I would first check if the apt-get update works then give this a try. – Maziyar Jan 05 '15 at 14:52
  • 2
    download the package by: sudo apt-get download resolvconf before you purge the installed one. You won't have network to download it otherwise. – HongboZhu Dec 01 '15 at 09:56
  • it's solve my network problem. Ubuntu 16.04 – Angel Cuenca Jan 03 '17 at 20:54
  • you can just remove and then sudo service networking restart and the resolvconf will be filled with correct values (given that you configured your interfaces first) – Thesane May 22 '19 at 01:27
11

Your DNS servers are not set or not working properly.

A DNS server basically translates (resolves) a domain name (like google.com) to an IP address. Without an IP address you can't connect to any website. So if a domain name can't be resolved, you can't access any website.

You can use Google's DNS servers to solve this problem:

  1. Click on the WiFi icon in the top right of your screen
  2. Click on Edit connections...
  3. Under Wi-Fi, select your network's name
  4. Click on Edit...
  5. Click on IPv4 Settings
  6. Set Additional DNS Servers to 8.8.8.8, 8.8.4.4 (note the difference between the dot and the comma)
  7. Click on Save

Try to visit Google to verify that your connection's working.

Louis Matthijssen
  • 11,885
  • 6
  • 44
  • 50
8

This is the problem. Ubuntu now by default sets 127.0.0.1 as your nameserver, placing that in your resolv.conf.

You can add a header to include your perferred name server such as google's dns by using the resolvconf header feature.

Add your preferred nameserver to your header file:

/etc/resolvconf/resolv.conf.d/head

nameserver 8.8.8.8

Be sure to place a linefeed at the end (press ENTER) after the line. Then restart your network and you should be all set.

This will place your preferred nameserver at the top of the default settings when your network starts.

You can restart your network by rebooting your computer or issue this cli:

sudo service networking restart
L. D. James
  • 25,036
  • 1
    thank you sir for your help but I don't know where I can find my header file? could you help me please? – user274227 Apr 26 '14 at 13:45
  • You're welcome. Look at my message again. Look were it says: file. I can't format it here in a comment, but it's formated in the answer: /etc/resolvconf/resolv.conf.d/head. That is the full pathname to the file. The line below that is what you have to put into that file. Follow the steps... restart the network and all your issues would vanish. – L. D. James Apr 26 '14 at 15:20
  • sudo nano /etc/resolvconf/resolv.conf.d/head – L. D. James Apr 26 '14 at 15:28
  • I did it but still not working I will post what I found when I did all the process in the question update. – user274227 Apr 26 '14 at 15:45
  • There is nothing to do by edit the file adding the Google name server quoted above. After you have done that, restart the network. You can do this by rebooting your computer. I can't imagine you having any problems after doing that. You can do other things, but there really isn't anything else that has to be done, unless you have changed your Ubuntu 14.04 installation from the behavior it was by default. I believe it would take a lot of changes to brake this feature. – L. D. James Apr 26 '14 at 15:48
  • maybe I miss something. could you check it out please? – user274227 Apr 26 '14 at 15:49
  • @user274227 Please execute the following command and restart your PC. sudo sh -c "echo 'nameserver 8.8.8.8' > /etc/resolvconf/resolv.conf.d/head". Please type it in your terminal exactly as shown here. Note the difference between ' and ". – Louis Matthijssen Apr 26 '14 at 16:47
  • 1
    Hi, Louis. I wouldn't recommend totally clobbering the file in that manner. He would best edit the file and append to it. If someone had already added search domain and other features he would loose those features. If he used, instead the command: "sudo nano /etc/resolvconf/resolv.conf.d/head" he'd benefit by seeing what is already there. He said he was having problems saving the changes. That wouldn't be a problem if he used "sudo". Also once adding the single line, he would automatically be prompted to save the file. – L. D. James Apr 26 '14 at 16:55
  • @user274227 What do you get when you type: "cat /etc/resolv.conf" ? If you have problems, it would be a most likely when you added the line you forgot to press ENTER at the end of the line. – L. D. James Apr 26 '14 at 16:56
  • @LouisMatthijssen I save te file and when I did "sudo service networking restart" it gave me this: "stop: Job failed while stopping" "start: Job is already running: networking" – user274227 Apr 26 '14 at 16:58
  • @L.D.James I got this: bash: cat/etc/resolv.conf: no such file or directory – user274227 Apr 26 '14 at 17:00
  • @user274227 you forgot to include the space between "cat" and "/etc" Also, I would suggest that you restart your network by rebooting your computer as indicated in my original answer above. – L. D. James Apr 26 '14 at 17:03
  • @L.D.James ok it gives me this now: # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)

    DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

    nameserver 127.0.0.1

    – user274227 Apr 26 '14 at 17:08
  • @user274227 I would have to see the after you have added the line to "head" and restarted the network. You can restart the network by rebooting as the message says above. By the way, some systems discourages quick/extensive dialog between users. The full resolution is in the original answer given above. You can post your question at http://forum.apollo3.com/?networksupport and continue the extended comments for further tutoring on this subject. But the bottom lines is to make the changes and reboot your computer as indicated in the orignal answer. – L. D. James Apr 26 '14 at 17:16
  • @L.D.James ok i'll post it – user274227 Apr 26 '14 at 17:28
  • @L.D.James i followed every step and after that i did this: "sudo service networking restart" i gave me: stop: Job failed while stopping
    1. start: Job is already running: networking
    – user274227 Apr 26 '14 at 17:40
6

Recreate /etc/resolv.conf by running the following in Terminal (Ctrl+Alt+T) and it should fix the issue with ping:

sudo dpkg-reconfigure resolvconf

or

sudo ln -sf /run/resolvconf/resolv.conf /etc/resolv.conf
David Foerster
  • 36,264
  • 56
  • 94
  • 147
Shayan
  • 1,503