4

Yesterday the internet connection was working correctly and I accepted software updates.
Today I can reach the default gateway and the DNS servers (8.8.8.8), but no internet address such as www.google.com through ping. No browser or internet service (dropbox) is working. I've checked the ethernet cable and the wireless connection.

The laptop is a macbook pro 2007 running Ubuntu 14.04 with triple boot.
The network connection works perfectly form the windows 8.1 installation.

Any hint on how to get internet connection on Ubuntu again?

Ubuser
  • 53
  • Note: Some VPN software fiddles with /etc/resolv.conf while it shouldn't (e.g. in SystemD). This is the case of SonicWall's NetExtender. – Ondra Žižka Sep 20 '22 at 18:07

4 Answers4

4

How does your /etc/resolv.conf file look like?

Try this command: sudo echo "nameserver 8.8.8.8" > /etc/resolv.conf

or

Do it manually by open the resolv.conf file and put in the DNS server you'd like use.

Mudit Kapil
  • 2,051
  • 7
  • 30
  • 47
krt
  • 1,956
  • 15
  • 12
  • @ElderGeek I do believe he is attempting to answer the question. – Seth Mar 29 '15 at 18:24
  • Thank you for the help, this worked fine. But now I don't know what happened. Why did it stopped working in the first place. Does this means that it is going to use only the first google dns from now on? – Ubuser Mar 29 '15 at 19:31
1

I think you should check new location.

Add your nameserver to/etc/resolvconf/resolv.conf.d/base.

Afterwards, run resolvconf -u.

Fabby
  • 34,259
  • At first I tried in the header file but it didn't worked. Apparently it works editing directly resolv.conf – Ubuser Mar 29 '15 at 22:28
0

If this is a desktop edition, you'd have to use network-manager to check your DNS servers. This can be done by clicking the network icon in the taskbar(bottom right) (if on wifi, it has a wifi symbol, if on ethernet it has a plug-like symbol) and selecting edit connections. Then double-click on your connection and proceed to IPv4 settings. Here, you can add the 8.8.8.8 DNS server. When adding DNS servers, however, I'd recommend you also change the dropdown box which says DHCP to DHCP for address only, so the DHCP doesn't supply you with a DNS server as well. (If you want to do this, you'll also need a router IP, which can be obtained by typing route -4 -n at commandline. It will give output like this:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.0.2        0.0.0.0         UG    6      0        0 home
10.0.0.0        0.0.0.0         255.0.0.0       U     0      0        0 home
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo

Simply use the Gateway value as your router.

If it's a server edition, you can follow @Kasper's instructions:

sudo echo "nameserver 8.8.8.8" > /etc/resolv.conf

or manually edit the resolv.conf file and put in the dns server you'd like use.

Elder Geek
  • 36,023
  • 25
  • 98
  • 183
Wilhelm Erasmus
  • 728
  • 5
  • 24
0

The problem is probably because of the package resolvconf, see man page.

It is used to simplify adding and removing DNS servers from different sources. So the previous contents of /etc/resolv.conf is now managed by the the program resolvconf(8).

So, if you manage your network from /etc/network/interfaces, which is is good for servers, you just add dns-nameservers and dns-search for the right interface. See man page for resolveconf(8).

If it is from NM, I don't have a qlue, probably add to the static settings for the interfaces. If managed from DHCP, it should be set anyway.

Anders
  • 1,585