resolvectl
Query and manage systemd-resolved DNS settings
TLDR
SYNOPSIS
resolvectl [OPTIONS] COMMAND [NAME...]
DESCRIPTION
resolvectl resolves domain names, IPv4 and IPv6 addresses, DNS resource records, and services. It introspects and reconfigures the DNS resolver through systemd-resolved.
PARAMETERS
-4, --ipv4
Query only IPv4 addresses-6, --ipv6
Query only IPv6 addresses-t, --type TYPE
Query specific DNS record type--class CLASS
Query specific DNS class--legend yes|no
Show/hide result legend--cname yes|no
Follow CNAME redirects-p, --protocol
Specify protocol (dns, llmnr, mdns)
COMMANDS
query HOSTNAME|ADDRESS
Resolve hostnames or reverse lookup addressesservice [[NAME] TYPE] DOMAIN
Resolve DNS-SD or SRV serviceopenpgp EMAIL
Query OpenPGP keystlsa [FAMILY] DOMAIN[:PORT]
Query TLS server certificatesstatus [LINK]
Show DNS settings per interfacestatistics
Show resolver statisticsreset-statistics
Reset resolver statisticsflush-caches
Flush all local DNS cachesreset-server-features
Reset learned server featuresdns [LINK [SERVER...]]
Get/set DNS servers per linkdomain [LINK [DOMAIN...]]
Get/set search domains per linkdnssec [LINK [MODE]]
Get/set DNSSEC modenta [LINK [DOMAIN...]]
Get/set DNSSEC negative trust anchors
CAVEATS
Requires systemd-resolved to be running and `/etc/resolv.conf` to point at its stub resolver (`127.0.0.53`) for host resolution to actually use it. Per-link settings (`dns`, `domain`, `dnssec`) apply only until the next time the interface is brought up unless persisted via a `systemd-networkd` .network file or NetworkManager. `flush-caches` drops cached answers but does not change configured upstream servers.
HISTORY
resolvectl is part of systemd, providing DNS resolution through systemd-resolved. It replaces the older systemd-resolve command.
SEE ALSO
dig(1), nslookup(1), resolved.conf(5)
