I have setup an Ubuntu server with a static IP and I cannot get the DNS to work. Pinging any domain (such as google.com) will not redirect me. I have tried editing /etc/resolv.conf, but that didn't work and it just keeps getting overwritten.
I also tried adding the dns-nameservers x.x.x.x x.x.x.x line to /etc/network/interfaces. I tried this using both my ISP's DNS (obtained it from my Windows desktop with ipconfig) and Google's (8.8.8.8 8.8.4.4), but it still won't work.
Best Answer
A work around to solve this is to temporarily add the domains you need to the
/etc/hosts
file.That provided enough connectivity to
sudo aptitude
to resolve the broken dependencies on the system.After the upgrade, Ubuntu rebooted normally and I could remove the static IPs from the hosts file again.
I used the following to capture the domains I needed to update and put them into a text file:
sudo apt-get update >> domains.txt
I used the following to grab the IPs I needed:
The following is the sh file I created and saved as domain-nslookup.sh:
After verifying that it worked as planned, I added the IPs and domains to the hosts file: