Ubuntu – I can ping IPs but can’t resolve domains

dnsUbuntu

I have Xubuntu 14.04 installed on my server. network-manager is not installed. It seems to have lost its ability to resolve domains, and I'm not sure where to begin diagnosing the issue.

ping 8.8.8.8 pings normally.

ping google.com returns ping: unknown host google.com.

I tried adding a DNS server to /etc/network/interfaces/. Now it contains:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.0.100
gateway 192.168.0.1
netmask 255.255.255.0
dns-nameservers 8.8.8.8 8.8.4.4

This didn't fix the problem, so I tried running:

hesse@galois:~$ sudo service networking restart
stop: Job failed while stopping
start: Job is already running: networking

I tried stop then start and reload but they didn't seem to do anything.

How do I diagnose the problem?

Note: It is a lot of work for me to restart the machine (I need to connect a keyboard and monitor to it), so please suggest solutions that don't require restarting if possible.


/etc/resolv.conf:

# 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

Best Answer

You need to solve the emptiness of your /etc/resolv.conf before hoping for some other error.

It should reflect at least one resolver. Should this be the only problem, your resolving should work.

Try

vi /etc/resolv.conf

Go into the edit mode. Add the below thing:

nameserver 8.8.8.8
nameserver 8.8.4.4

See post that if

ping google.com

Works.

Related Question