resolvectl

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

Typical usage: dns configuration, information gathering, network troubleshooting

Installation

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
AlmaLinuxsystemd-resolved
dnf install systemd-resolved
Arch Linuxsystemd
pacman -S systemd
Debiansystemd
apt install systemd
Fedorasystemd-resolved
dnf install systemd-resolved
Red Hat Enterprise Linuxsystemd-resolved
dnf install systemd-resolved
Rocky Linuxsystemd-resolved
dnf install systemd-resolved
Ubuntusystemd
apt install systemd

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

Usage

Available options

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

Missing an option in this overview? Share your feedback.

Subcommands

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.

Examples using resolvectl

Resolve domain name or IP address

Perform a lookup of the linux-audit.com domain

resolvectl query linux-audit.com

Query specific DNS records

Usage of --type in combination with query

resolvectl query --type=ns linux-audit.com

Avoid caching when performing queries

Avoid the cache when querying a record

resolvectl query --type=a --cache=false linux-audit.com

Clear DNS cache

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

resolvectl flush-caches

Frequently Asked Questions

What is the resolvectl command and its purpose?

The command resolvectl provides details about systemd-resolved. Discover the available options for the name resolution daemon on Linux systems.

Which package provides the resolvectl command?

The command resolvectl is provided by the systemd or systemd-resolved package.

Relevant articles using the resolvectl command

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

Related and similar commands

Linux has a lot of tools and commands available and sometimes you just need that little other tool. Here is a list of commands that are similar or related to resolvectl:

Related and similar commands to resolvectl
CommandCategorySummary
digDNSPerforms DNS requests
fuserfiles and socketsShow processes using a file or socket
iftopnetworkBandwidth usage monitor
ipnetworkingShows network configuration and information
nstatnetworkNetwork statistics and counters
sssocketsShows information about sockets
systemd-analyzeperformancePerformance and security analyzer of systemd components
tcpdumpnetwork sniffingMonitors network traffic on specified interface

Also 💙 the command-line or terminal? Here is a set of cheat sheets for Linux to get more done from within the shell: