Some how I've messed up the DNS after a failed app install! I notice that in /etc/ there are 3 resolv files:
resolv.conf
resolv.conf_bak
resolv.conf-tmp
resolv.conf contains:
#Generated by NetworkManager
search lan
nameserver 127.0.0.53
resolv.conf_bak contains:
# This file is managed by man:systemd-resolved(8) ...
nameserver 127.0.0.53
options edns0 trust-ad
search lan
resolv.conf-tmp contains:
nameserver 1.1.1.1
nameserver 8.8.8.8
systemctl status systemd-resolved
returns:
systemd-resolved.service
Loaded: masked (Reason: Unit systemd-resolved.service is masked)
Active: inactive (dead)
In the Wifi network settings (GUI) the IPs 8.8.8.8 and 1.1.1.1 are listed under IPv4 DNS and IPv4 method is Automatic (DHCP), DNS and Routes are also set to Automatic.
I had installed OpenLiteSpeed webserver which is accessible via localhost:7080 but probably this install has upset domain name resolution and browsing. I don't know enough about Linux DNS to know where else to look for the conflict. Should I try re-installing systemd-resolved as posted here?
UPDATE 1:
Following suggestions in this post I ran ls -l /etc/systemd/system/systemd-resolved.service
and got this reply: "ls: cannot access '/etc/systemd/system/systemd-resolved.service': No such file or directory"
I then ran sudo systemctl unmask systemd-resolved
and the reply was "Removed ...". I then ran the following commands:
sudo systemctl daemon-reload
sudo systemctl start systemd-resolved
sudo systemctl enable systemd-resolved
The last one confirmed the creation of a symlink from /etc/systemd/system/dbus-org.freedesktop.resolve1.service to /lib/systemd/system/systemd-resolved.service and also one from /etc/systemd/system/multi-user.target.wants/systemd-resolved.service to /lib/systemd/system/systemd-resolved.service
sudo systemctl status systemd-resolved
now returns Unit system-resolved.service could not be found.
UPDATE 2:
If I add nameserver 8.8.8.8
to /etc/resolv.conf
then name resolution/browsing is restored, but this file is generated by resolvconf so I assume it will be overwritten!
This post suggests adding the nameserver to /etc/dhcp/dhclient.conf
with supersede domain-name-servers 8.8.8.8;
Any ideas please?