On this machine /etc/resolv.conf is a plain file: the exercise setup wrote it. On an Ubuntu server it is usually set up differently.
There /etc/resolv.conf is a symbolic link to a file of the systemd-resolved service, and it says nameserver 127.0.0.53. That is the address of the service itself, on the same machine: programs ask it, and it forwards the questions to the real DNS servers. resolvectl status prints their list.
The service rewrites the linked file itself, so a manual edit there does not last. On such a machine DNS servers are set in the network settings — for example, in Netplan, which you met in the addressing module.
On an Ubuntu server /etc/resolv.conf links to a systemd-resolved file that says nameserver 127.0.0.53. What does that mean?
-
The address is indeed on this machine: systemd-resolved listens there and forwards questions to the real servers.
resolvectl statusshows which. -
The servers are set in the systemd-resolved settings, not in this file.
resolvectl statusshows whether there are any. -
systemd-resolved maintains the file and will overwrite the edit. On such a machine you change servers where the service takes them from — for example, in the Netplan settings.
127.0.0.53 is systemd-resolved's address: programs ask it, and it forwards the questions to the DNS servers in its settings. resolvectl status prints those servers.
Key points
-
127.0.0.53inresolv.confis systemd-resolved on the same machine;resolvectl statusshows the real servers. - Change a setting where it is taken from: a file maintained by a service gets rewritten.