/run/resolvconf/resolv.conf gets erased each time I restart, and I can't use internet without it (16.04)
Solution 1
You should restore the resolv.conf symbolic link and add required nameservers to /etc/resolvconf/resolv.conf.d/base. Follow these steps:
Reinstall resolvconf package:
$ sudo apt-get -o Dpkg::Options::="--force-confmiss" install --reinstall resolvconf
Add required nameservers to /etc/resolvconf/resolv.conf.d/base:
$ sudo bash -c 'echo "nameserver 8.8.8.8" >> /etc/resolvconf/resolv.conf.d/base' $ sudo bash -c 'echo "nameserver 8.8.4.4" >> /etc/resolvconf/resolv.conf.d/base'
Regenerate resolv.conf:
$ sudo resolvconf -u
Restart your network interfaces:
$ sudo ifdown -a ; sudo ifup -a
Solution 2
I think the resolv.conf is not updated automatically. You can reconfigure it
sudo dpkg-reconfigure resolvconf
Related videos on Youtube
Antonio Kuri
Updated on September 18, 2022Comments
-
Antonio Kuri over 1 year
I have been solving issues with my ubuntu - windows partition. So after having an issue with the clock of the system and i think this triggering that I couldn't log into my user (it just bounced back) but being free to log like guest, so I created a new user like suggested here.
So, it worked, but now I couldn't load anything although the icon appeared like connected, both wireless and ethernet. So I found a solution... somewhere, that said to add to
/etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
So, I found it but it had a symlink to
/run/resolvconf/resolv.conf
and it didn't exists, so I made one with only said lines. And the internet worked then!!But when I restart the computer,
/run/resolvconf/resolv.conf
is gone so I have to make one again each time.How can I fix this? Apparently there aren't any other symlinks broken, and I have also done this with no result. Thanks everybody
-
Admin over 7 yearsTry running
sudo dpkg-reconfigure resolvconf
and answering 'Yes' when it asks you if you want to prepare /etc/resolv.conf for dynamic updates. -
Admin over 7 years@Antonio Kuri Have you tried some of these solutions?
-
Admin over 7 yearsYeah, I just did. Something is missing
-
Admin over 7 years@AntonioKuri I've updated my answer. Try from the beginning again. Changed step 1.
-
-
Antonio Kuri over 7 yearsWhen running step 3, it gives back: run-parts: failed to open directory /etc/resolvconf/update.d: No such file or directory
-
Antonio Kuri over 7 yearsIt does make that persistent but doesn't help to fix the connection. No site loads
-
Antonio Kuri over 7 yearsNetworkManager just crashed while doing nothing. Executable path: /usr/sbin/NetworkManager
-
Thiago Rider Augusto over 7 yearsDid you tried restarting NetworkManager?
-
Antonio Kuri over 7 yearsDoing the stated worked. Now I restart and the connection works just fine. Thanks