What does /etc/resolv.conf contain and how does systemd-resolved change it?

IntermediateConceptDNS
Answer

nameserver lines, search domains and options. On modern Ubuntu it is a stub pointing to 127.0.0.53, with systemd-resolved doing caching and per-link DNS settings.

resolvectl status
resolvectl query example.com

Editing resolv.conf by hand is overwritten; configure via netplan, NetworkManager or resolved.conf.

All Networking questions Roadmap: Networking for DevOps

More on DNS