Ubuntu has this fancy system where by /etc/resolv.conf
isn’t actually a proper resolver but refers to a local server called 127.0.0.53. To be honest this is just a pain in certain circumstances because you lose control.
To see the mess, you can just start googling. You end up with 100s answers.
So to restore your system to a sensible state where you actually have control, you have to follow all these crazy steps:
sudo apt install resolvconf sudo systemctl enable resolvconf.service sudo systemctl start resolvconf.service sudo nano /etc/resolvconf/resolv.conf/head
Add the following two name servers to the head
:
nameserver 1.1.1.1 nameserver 8.8.4.4
Restart the service:
sudo systemctl restart resolvconf.service
To check your work:
cat /etc/resolv.conf | grep -v '#'
The above command does an invert match so it will display lines that do not have comments.
What a mess. Well done Ubuntu.