snippetbashTip
resolvectl — Resolve domain names, IPv4 and IPv6 addresses, DNS resource records, and services. Introspect and re
Viewed 0 times
commandanddomainnamesresolvecliipv4resolvectl
linux
Problem
How to use the
resolvectl command: Resolve domain names, IPv4 and IPv6 addresses, DNS resource records, and services. Introspect and reconfigure the DNS resolver. See also: dig, nslookup, host. More information: <https://www.freedesktop.org/software/systemd/man/latest/resolvectl.html>.Solution
resolvectl — Resolve domain names, IPv4 and IPv6 addresses, DNS resource records, and services. Introspect and reconfigure the DNS resolver. See also: dig, nslookup, host. More information: <https://www.freedesktop.org/software/systemd/man/latest/resolvectl.html>.Show DNS settings:
resolvectl statusResolve the IPv4 and IPv6 addresses for one or more domains:
resolvectl query {{domain1 domain2 ...}}Retrieve the domain of a specified IP address:
resolvectl query {{ip_address}}Flush all local DNS caches:
resolvectl flush-cachesDisplay DNS statistics (transactions, cache, and DNSSEC verdicts):
resolvectl statisticsRetrieve an MX record of a domain:
resolvectl --legend {{no}} {{[-t|--type]}} {{MX}} query {{domain}}Resolve an SRV record, for example _xmpp-server._tcp gmail.com:
resolvectl service _{{service}}._{{protocol}} {{name}}Retrieve a TLS key:
resolvectl tlsa tcp {{domain}}:443Code Snippets
Show DNS settings
resolvectl statusResolve the IPv4 and IPv6 addresses for one or more domains
resolvectl query {{domain1 domain2 ...}}Retrieve the domain of a specified IP address
resolvectl query {{ip_address}}Flush all local DNS caches
resolvectl flush-cachesDisplay DNS statistics (transactions, cache, and DNSSEC verdicts)
resolvectl statisticsContext
tldr-pages: linux/resolvectl
Revisions (0)
No revisions yet.