My /etc/resolv.conf (and also /run/systemd/resolve/resolv.conf) contain a search
entry for wifi.ns.nl
that I did not put there and do not want there. It seems related to a problem I have now in that I cannot resolve some web addresses. The resolv.conf files are managed by systemd-resolved and tell me not to edit them manually. If I do that anyway nothing changes and if I restart sytsemd-resolvd it changes the resolv.conf files back to their original state.
The search wifi.ns.nl
line probably appeared after I tried to connect to a captive wifi network run by ns.nl
. After connecting to the wifi, but before accepting the terms on the web portal, I tried to connect with SSH to a server. That didn't work, and accessing any other website through the wifi also did not work. When I came home and connected to my home network, connecting to the server I wanted to connect to still didn't work, and systemd-resolve
now says resolve call failed: No appropriate name servers or networks for name found
for that server and for *.wifi.ns.nl. (I can still connect to the server using the ip address, and I can resolve the name using dig
on a remote dns server, so the problem is only my local DNS resolver.)
If I do systemd-resolve --status
it also tells me 'wifi.ns.nl' is one of my global DNS Domains.
Apparently something somewhere has remembered some setting probably related to the captive wifi network and wifi.ns.nl
. I've tried restarting systemd-resolved
, networking
, network-manager
, but the search entry is still there.
(I also did a sudo grep -R wifi.ns.nl /etc
, it doesn't find 'wifi.ns.nl' anywhere else under /etc
other than the resolv.conf file)
How can I remove that search entry, other than rebooting my system?
It seems to be the bug described here. If both systemd-resolved and the
resolvconf
package are installed they fight over who gets to manage/etc/resolv.conf
. If there are anysearch
lines in that file these domains break for a reason I don't quite understand yet.In my case, with both installed
/etc/resolv.conf
was a symlink to/run/resolvconf/resolv.conf
. After removing theresolvconf
package it became a symlink to/run/systemd/resolve/stub-resolv.conf
and after restarting thesystemd-resolved
service that fixed the problem.I have the same problem, and the simplest solution is to edit
/etc/resolve.conf
and remove the 'search' lines.No restarting required, and things work again.
This, however, is not a solution, as any time I use my vpn or connect my laptop to the work network, it happens all over again. I too don't understand the bug (haven't even tried yet, as I have too many other new annoyances since the switch from Unity on 17.04 to Gnome on 17.10). But that's an answer that addresses your (or others coming later) problem without a reboot.