2

I am having trouble getting my Ubuntu server to connect to the internet. To be clear, LAN works perfectly. I am running 14.04 LTS. I cannot ping Google.com yet ssh works over the internet as well as LAN. I do have a static IP set up, but that was working before. I set my DNS servers to google's, but still nothing. apt-get install/update returns cannot resolve host to us.archive.Ubuntu.com. My repo sources are working. I am out of ideas regarding what to do next. Any help would be VERY appreciated.

Still broken with and without the nameservers in interfaces and still able to ping 8.8.8.8 with both

Here's interfaces, resolv.conf is empty.

auto lo
iface lo inet loopback

auto eth0

#iface eth0 inet dchp

iface eth0 inet static
        address 192.168.1.3
        network 192.168.1.0
        netmask 255.255.255.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
        nameserver 8.8.8.8
        nameserver 8.8.4.4
  • Try ping 8.8.8.8 -- did that work? If so, you have network connectivity. If that ends up being the case, then your DNS is boken. How (or where/which file) did you set your DNS servers? Can you show us /etc/resolv.conf and /etc/network/interfaces? (Let me guess: you are doing SSH by IP. I bet your DNS is just broken). – Azendale Jan 15 '16 at 0:51
  • Pinging 8.8.8.8 works, so DNS is broken. Thank you for your help! – Noah Christensen Jan 15 '16 at 1:03
  • Ok, so then it really seems like however you set the DNS didn't work. Did you set it in /etc/network/interfaces? In /etc/resolv.conf? /etc/resolvconf/resolv.conf.d/{head|tail|base}? – Azendale Jan 15 '16 at 1:23
  • @Azendale Added interfaces, resolv.conf is empty – Noah Christensen Jan 15 '16 at 1:52
2

You were very close with your /etc/network/interfaces configuration.

It should have been something like this:

iface eth0 inet static
        address 192.168.1.3
        network 192.168.1.0
        netmask 255.255.255.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
        dns-nameservers 8.8.8.8 8.8.4.4

The nameservers <ip> syntax is if you go the resolvconf route instead. (See https://askubuntu.com/a/51332/9308 for the details on that route.) It sounds like you got it for the most part on your own though and it is working.

0

FIXED!

added nameserver 8.8.8.8 to etc/resolvconf/resolv.conf.d/base and works perfectly now. Thank you @Azendale!

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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