Page MenuHomePureOS Tracker

DNS settings are not being updated after switching wifi networks
Open, NormalPublic

Description

When switching from one wifi network to another one, or when swtching to a VPN tunnel, DNS (in /etc/resolv.conf) are not being updated. The result is that no server can be retrieved.

After running "sudo resolvconf -u" I got a warning saying "/etc/resolv.conf is not a symbolic link to /etc/resolvconf/run/resolv.conf"

Indeed, /etc/resolv.conf was not a symbolic link and had the DNS of the network that I was using for installing the system.

Recreating the link fixed the problem.

Event Timeline

francois created this task.Feb 1 2018, 12:57
chris.lamb renamed this task from DNS are not being updated to DNS settings are not being updated after switching wifi networks.Feb 2 2018, 11:49

I can't reproduce this:

$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.2.1
search lan

I then switch networks:

$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 10.0.1.1

DNS works in both cases. Are you doing anything strange/non-standard with your DNS? Perhaps you can paste your resolv.conf for both pre- and post-?

For some reason, on my PureOS install, /etc/resolv.conf was not a symbolic link to /etc/resolvconf/run/resolv.conf and was never updated.

Also, I found this : https://tracker.pureos.net/w/troubleshooting/connected-to-wifi-but-no-connection/ and was thinking that if you need to edit /etc/resolv.conf manually, it may indeed never be updated automatically, so I may not be the only one having a problem.

Okay but doesn't the resolv.conf have a big warning in it saying "do not edit this file"? :p

Yes because it is supposed to be automatically updated.

So I suspect that if this troubleshooting ticket exists is because /etc/resolv.conf is not created correctly on a clean install of PureOS. Instead of being a symbolic link to /etc/resolvconf/run/resolv.conf (which is the file that resolvconf updates), it is a real file.

I think that we should fix the install and remove this troubleshooting post that is mainly a workaround to the real problem.

/etc/resolv.conf is not created correctly on a clean install of PureOS

Except that it *is* installed (correctly) on a clean install of PureOS — I did one only yesterday! :)

OK, it may be from an older install or something has gone wrong on my side for some reason...

Thank you @chris.lamb ! You may close that issue.

Will do! Thanks!

chris.lamb closed this task as Resolved.Feb 14 2018, 08:10
patata reopened this task as Open.Jul 8 2018, 04:12
patata added a subscriber: patata.

(The one who fixed my laptop says:)

This problem still exists (and pureos is probably aware of it as there exists still the corresponding section in the troubleshooting wiki - https://tracker.pureos.net/w/troubleshooting/connected-to-wifi-but-no-connection/)
The solution that worked for me was

dpkg-reconfigure resolvconv

Seems to me the saner way to solve than proposed in the wiki.

pureos is probably aware of it as there exists still the corresponding section in the troubleshooting wiki

Just FYI I would be wary of inferring anything from the presence of something on the wiki - it is not kept as up-to-date as the tracker :)

chris.lamb added a subscriber: chris.lamb.

Assigning over for triage/priority :)

jonas.smedegaard removed zlatan.todoric as the assignee of this task.May 27 2021, 06:10
jonas.smedegaard triaged this task as Normal priority.