Question
Ping: unknow host but can ping IPs
After restarting my droplet [Ubuntu 15.10 x64], I keep getting “unknown host” message. Pinging IPs though works fine.
I cannot cat resolv.conf, it says “No such file or directory” although on ls -l it does appear as a linked file to /run/resolvconf/resolv.conf. which I cannot access either - no resolvconf folder in run dir.
In /etc/network/interfaces, I have dns-nameservers 8.8.8.8 8.8.4.4 under eth0.
Sorry if any of the above information is irrelevant, I am a Linux noob.
Any help would be greatly appreciated!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
Note: your system probably requires you to use ‘sudo’ in front of your privilege access commands, or need to issue 'su root’ to gain full root access. Try
So, reboot cleared out your DNS cache and now your DNS servers have gone dark. Can you ping IP address 8.8.8.8 or 8.8.4.4 ?
I always log in with root, but tried
sudo cat /etc/resolve.conf
anyway. The result is the same “No such file or directory”.I can ping both 8.8.8.8 and 8.8.4.4. I can also ping the gateway.
One additional note though, I was playing around with ufw before restarting the droplet. However, after discovering this issue, I have inactivated it, but the problem persists.
@medowlock - Does your system have a /var/run/resolvconf/resolv.conf
If it’s there, for diagnostic purpose, create a link to it in etc
Then try ping digitalocean.com
This is where it gets really weird, at least for me. When listing the contents of /etc I can see there is a file resolv.conf symlinked to /run/resolvconf/resolv.conf. However
And running the command you mentioned gives
Thanks for all your answers and patience!
@medowlock - Oops, need to remove the existing file before the link command:
@gndo No luck.
But I did manage to get it working again. What I did was remove the symlink altogether and created the resolv.conf file manually and added to its contents:
@medowlock - So that means that the program (resolvconf) that dynamically creates that file, had failed and probably wrote something in your system logs. At some point you will want to look for that and fix the root cause since a future update could mess you up again.