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.
More on DNS
What does DNS do and what happens when you type a URL into a browser?BeginnerWhat are the common DNS record types?BeginnerWhat is the difference between a recursive resolver and an authoritative server?IntermediateExplain the DNS resolution chain step by step with dig.IntermediateWhat is TTL in DNS and how does it affect changes?BeginnerWhat is negative caching in DNS?Intermediate