4

Last night the machine was working fine. This morning, no internet access.

I'm working with a wired Ethernet connection.
I can ping the router, but not google.
I am able to access shared files on the machine from another computer through the wired network.

Other machines on the network can access the internet. It's only the Ubuntu box that can't get internet.

I can ping google by address but not by name.

output of lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial

nmcli dev show | grep DNS partial results:

IP4.DNS[1]: 192.168.0.1

Which is the router address.

`
more /etc/resolve results:

 # Generated by OpenVPN Client UP Script  

 nameserver 10.8.0.1

ls -1 /etc/resolv.conf results:

-rw-r--r-- 1 root root 172 Feb 23 22:34 /etc/resolv.conf

3

It's my understanding that /etc/resolv.conf is for public nameservers only. It appears that yours has been modified to use a private nameserver ostensibly over a VPN. If you wish your Ubuntu box to obtain Domain Name Service normally to allow internet access, I suggest that you revert back to the default /etc/resolv.conf file which contains:

# 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.1.1

You can revert back to the default /etc/resolv.conf file by either restoring the original from a recent backup from before it was modified, or opening the file the link points to with the command sudo gedit /etc/resolv.conf and pasting the code from the default file above into it overwriting it's current content. You may want to save a copy of the current content beforehand as a backup somewhere you will be able to locate it if you find you need it.

NOTE: /etc/resolv.conf is a symbolic link to the file /run/resolvconf/resolv.conf so file based operations such as editing on /etc/resolv.conf will actually be carried out on /run/resolvconf/resolv.conf

To confirm that the link hasn't been erroneously modified run the command ls -l /etc/resolv.conf which should result in the output below.

lrwxrwxrwx 1 root root 29 Feb 25 2016 /etc/resolv.conf -> ../run/resolvconf/resolv.conf

the arrow indicates it's a symlink.

For more information on resolvconf which modifies this file see the man page.

  • When I try to create the symbolic link using ln -s /run/resolvconf/resolv.conf /etc/resolv.conf, I get: ln: failed to create symbolic link '/etc/resolv.conf': File exists – D. Dieks Feb 26 '17 at 18:03
  • OK, you've lost me now. Can you give me more detail on what I should be doing? You'll have to remove the file you created after deleting the link to recreate it makes no sense to me. – D. Dieks Feb 26 '17 at 22:56
  • I didn't delete /etc/resolv.conf. I edited it as per your directions. – D. Dieks Feb 26 '17 at 23:17
  • Well, something modified it inappropriately. See my updated answer. – Elder Geek Feb 26 '17 at 23:26
  • 1
    This answer fixed my issue too. In my case the /etc/resolv.conf does not have nameserver 127.0.1.1. – inullpointer Feb 17 at 16:42
2

If you have an unmodifed /etc/resolv.conf file (and you should) you should change System Settings -> Network -> Options to be set as shown below so that your router will provide DNS services to your Ubuntu box as it does to your other systems.

DHCP

An alternative is to use Google public DNS service and add 8.8.8.8 and 8.8.4.4 as your DNS servers.

  • Switched over to settings as shown above. No change. Still can't get internet access. – D. Dieks Feb 23 '17 at 21:40
  • Please edit the output of more /etc/resolv.conf into your post Thank you for helping us help you! – Elder Geek Feb 24 '17 at 0:11
0

I had a similar problem and my resolv.conf file was as shown in Elder Geek's post . I did :
1. Changed System -> Network -> Options to Automatic(DHCP)
2. sudo apt-get update
3. sudo apt-get upgrade
4. Repeat Setp 2 and 3 multiple times.

I know this is not a very technical way of answering as it doesn't answer the root cause (or talk about it). But it worked for me. Let's see if it works for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.