resolvectl shows the information related to name resolution coming from the resolve daemon


When resolvectl is not installed by default, it can be added to the system using the relevant software package.

Package information for resolvectl

Operating systemPackage nameInstallation
dnf install systemd-resolved
Arch Linuxsystemd
pacman -S systemd
apt install systemd
dnf install systemd-resolved
Red Hat Enterprise Linuxsystemd-resolved
dnf install systemd-resolved
Rocky Linuxsystemd-resolved
dnf install systemd-resolved
apt install systemd

Your Linux distribution using a different package? Share your feedback.



CommandDescriptionExtra information
flush-cachesClear DNS cache
reset-statisticsReset the counter of the resolver statisticsRoot privileges required
statisticsShow resolver statistics
status [LINK]Show DNS settings (global or link)LINK equals the interface

Missing a command? Share your feedback.

Available options

Short optionLong optionDescription
-i IFACE--interface=IFACEDefine interface to be used together with a DNS query
-t TYPE--type=TYPEDefine DNS record type, to be used with query command

Missing an option in this overview? Share your feedback.

Examples using resolvectl

Resolve domain name or IP address

Perform a lookup of the domain

resolvectl query

Query specific DNS records

Usage of --type in combination with query

resolvectl query --type=ns

Avoid caching when performing queries

Avoid the cache when querying a record

resolvectl query --type=a --cache=false

Clear DNS cache

Flush the cache that stores DNS records. Useful for clearing out outdated results.

resolvectl flush-caches

Relevant articles using the resolvectl command

The following articles include an example on how to use resolvectl and might be worth further exploring.