1

Yesterday I messed up my network settings on Lubuntu 16.04. Wifi had problems and I thought it was my problem, it turned out later, that the problem was a temporary problem with the central wifi, it basically showed as connected but I could not load any pages in Firefox.

Trying to fix it I am afraid i screwed up my DNS and networking settings :(

I followed the advice of doing:

sudo apt-get remove --purge resolvconf && sudo apt-get install resolvconf 

So I removed resolvconf but then of course I could not re-install it because internet was not working :(

I can "ping 8.8.8.8" but I can't reach google.com as I get:

ping: unknown host google.com

This, as far as I understood means a DNS problem.

I think resolvconf is necessary for fixing my problem, I tried editing the config file adding

nameserver 8.8.8.8
nameserver 8.8.8.4

But It does not work :(

On my laptop fortunately I also have Windows 10 on a small partition, I used it to download the .deb file of resolvconf from http://packages.ubuntu.com/ but it gives me a MIMEtype error and does not let me install it.

I tried downloading the tar.gz but when I extract it I can't do

./config (or configure)

because I get:

debconf: DbDriver "passwords" warning: could not open /var/cache/debconf/passwords.dat: Permission denied
Template parse error near `# These templates have been reviewed by the debian-l10n-english', in stanza #1 of ./templates

How do I reinstall resolvconf and how do I fix the "ping: unknown host google.com" internet problem? I tried to look online and on askubuntu but no luck so far :(

I am desperate as I am on holiday and I really need Lubuntu connected to the network, Windows 10 is damn slow and I don't like it :(

If anyone can help it would be great! Thank you in advance.

Edit: trying to run "cat /etc/resolv.conf" and "cat /etc/resolvconf/resolv.conf.d/base" gives me

no such file or directory

But if i check with Pacman in /etc/ I can find a "resolv.conf" file (which I opened and it is empty) and a "resolv.config" (which contains nameserver 8.8.8.8 and nameserver 8.8.4.4, which are Google DNS)

2
  • Edit it to include the output of the following: cat /etc/resolv.conf / cat /etc/resolvconf/resolv.conf.d/base Jul 8, 2016 at 17:40
  • Edited as per Thiago request
    – Paguro
    Jul 9, 2016 at 20:20

3 Answers 3

5

Problem: In my case I accidentally removed the resolvconf file. So my computer is connected to the internet, but it has no idea what a DNS server is and so it has no way of translating readable URLs into IP addresses. Hence you can do ping 8.8.8.8 and it will respond, but ping google.com fails.

So the solution is basically to reinstall resolvconf. You can download the package from the Ubunut archive: http://archive.ubuntu.com/ubuntu/pool/main/r/resolvconf

One neat hack around this is to go to another computer, or your phone, or whatever and find out the address of archive.ubuntu.com - just ping it and copy the IP address. You could also use a WHOIS service I guess.

Then go back to the Ubuntu system and open /etc/hosts and add:

x.x.x.x archive.ubuntu.com

where x.x.x.x is the IP address you found out via ping on another machine. So now your computer should know about archive.ubuntu.com. You can then open the page in a browser and navigate to the resolvconf package. Of course putting in that IP address would also work and you should probably avoid leaving it in your hosts file in case it changes later.

Download the most recent package, and then run sudo dpkg -i resolvconf_1.79ubuntu8_all.deb or whatever the deb file you downloaded was. I suggest manually running dpkg even if your browser prompts you to install it, it didn't work that way for me.

Presto: you now have resolveconf again and it should work more or less instantly.

1
  • not worked for me. ubuntu 18.04 Aug 8, 2020 at 8:08
3

This is what worked for me on Ubuntu 16.04; reinstalling resolvconf.

  • find your repo online, for example: http://de.archive.ubuntu.com.
  • get the ip of it since you can't resolve addresses. Write it down.
  • Log back into Ubuntu.
  • Use wget to download the resolvconf deb package and reinstall it. This will only solve the domain resolution.

example using IP of http://de.archive.ubuntu.com

wget 141.30.13.20/ubuntu/pool/main/r/resolvconf/resolvconf_1.78ubuntu2_all.deb
sudo dpkg -i resolvconf_1.78ubuntu2_all.deb
2
  • 1
    How do you propose they download the file if their system has no Internet? What IP is that, and why should we trust it? There's a lot of things missing from this answer which leave it as low quality; you may want to explain more about what these commands do.
    – Thomas Ward
    Dec 17, 2016 at 0:07
  • Sure, edited its the ip of de.archive.ubuntu.com. Dec 17, 2016 at 0:40
0

One idea: find out which DNS names are required to be resolved by apt when you want to install resolvconf again. Then, manually add entries to /etc/hosts for those DNS names. Find the actual IP addresses while you are booted into windows or so. For example, for the Singapore mirrors:

$ nslookup sg.archive.ubuntu.com
Server:     192.168.0.1
Address:    192.168.0.1#53

Non-authoritative answer:
Name:   sg.archive.ubuntu.com
Address: 91.189.88.162
Name:   sg.archive.ubuntu.com
Address: 91.189.88.149
Name:   sg.archive.ubuntu.com
Address: 91.189.88.152
Name:   sg.archive.ubuntu.com
Address: 91.189.88.161

Then the /etc/hosts would be:

127.0.0.1       localhost
91.189.88.162       sg.archive.ubuntu.com

You need to replace the hostname with your actual archive server (listed in /etc/apt/sources.list)

I didn't try this (as I don't want to mess up my DNS resolution), but it could work.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .