Recently my DNS settings stopped working. They are the same settings I've had for a while now, and I don't know what has changed. Now each time I restart my system, I have no internet connection, getting a "This site can't be reached" Error from my browser, and the contents of /etc/resolv.conf are reset to :

# Generated by NetworkManager

The automatically generated file does not leave me with a working configuration, even when I delete the below DNS addresses from the 'DNS Servers' field. I had to write a script to update resolv.conf on each restart, which is OK, and works, but it's not ideal, since I don't like not understanding what the problem really is.

I get that my immediate problem is the resolv.conf file is being reset each boot, and I don't know how to stop that. I don't get why it only just started happening, and I don't get why my internet no longer works without the new DNS servers being present in resolv.conf.. as that wasn't an issue before, it seemed to just default to the DNS of my ISP, but this is no longer the case it would seem.

Current settings:

enter image description here

  • using some VPN software in Linux? – Rui F Ribeiro Feb 9 '18 at 23:02
  • 1
    does doing sudo rm /etc/resolv.conf ; sudo ln -s /run/resolvconf/resolv.conf /etc/resolv.confsolve your problem? (confirm if you have a /run/resolvconf/resolv.conf file first) – Rui F Ribeiro Feb 10 '18 at 0:13
  • @RuiFRibeiro Why, yes it does! Thanks, if you fancy posting this as an answer I would gladly accept. – Totem Feb 10 '18 at 0:23
  • @RuiFRibeiro As an aside, any idea what might have caused this issue? – Totem Feb 10 '18 at 0:24
  • 1
    I am explaining it in the answer. – Rui F Ribeiro Feb 10 '18 at 0:24

Your DNS configuration is failing because when protonVPN is being activated, it is deleting your original /etc/resolv.conf symlink, and replacing it with a file of their own.

When it goes down, unfortunately, it does not recreate the symbolic link, and thus effectively creates a disconnect between the /etc/resolv.conf file and resolvconf/NetworkManager.

To correct this question, you have to run the following commands every single time after using (disconnecting) the VPN to restore the resolvconf symlink:

sudo rm /etc/resolv.conf
sudo ln -s /run/resolvconf/resolv.conf /etc/resolv.conf

I would also open a ticket with protonVPN, as this is a relatively known issue and a common occurrence with the software of some VPN providers.

Another possible (temporary) workaround for someone more familiar with Linux, is not being dependent on NetWorkManager and resolvconf, and dealing directly with the manual configuration of the interfaces.

  • This is why I asked wether a VPN was being used. – Rui F Ribeiro Feb 10 '18 at 0:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.