resolvectl - resolve domain names, IPV4 and IPv6 addresses, DNS resource records, and services; introspect and reconfigure the DNS resolver
resolvectl [OPTIONS...] {COMMAND} [NAME...]
Options you will use
status- upstream servers per link and the resolv.conf mode
query NAME- resolve through systemd-resolved; says whether it came from cache
flush-caches- drop the cache (root)
statistics- cache size, hits and misses
dns LINK SERVER...- set the servers for a link at runtime (root)
Examples
$ resolvectl statuswho does this box ask
$ sudo resolvectl flush-cachesforget cached answers here - and only here
Gotchas
- Flushing your cache does nothing for anyone else's resolver. TTLs are the only way to control how long other people hold an old answer.
Taught in
Try resolvectl in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.