resolvectl
resolvectl shows the information related to name resolution coming from the resolve daemon
Typical usage: dns configuration, information gathering, network troubleshootingInstallation
When resolvectl is not installed by default, it can be added to the system using the relevant software package.
Package information for resolvectl
Operating system | Package name | Installation |
---|---|---|
AlmaLinux | systemd-resolved |
|
Arch Linux | systemd |
|
Debian | systemd |
|
Fedora | systemd-resolved |
|
Red Hat Enterprise Linux | systemd-resolved |
|
Rocky Linux | systemd-resolved |
|
Ubuntu | systemd |
|
Your Linux distribution using a different package? Share your feedback.
Usage
Available options
Long option | Short option | Description |
---|---|---|
--interface=IFACE | -i IFACE | Define interface to be used together with a DNS query |
--type=TYPE | -t TYPE | Define DNS record type, to be used with query command |
Missing an option in this overview? Share your feedback.
Subcommands
Command | Description | Extra information |
---|---|---|
flush-caches | Clear DNS cache | |
reset-statistics | Reset the counter of the resolver statistics | Root privileges required |
statistics | Show 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:
Command | Category | Summary |
---|---|---|
dig | DNS | Performs DNS requests |
fuser | files and sockets | Show processes using a file or socket |
iftop | network | Bandwidth usage monitor |
ip | networking | Shows network configuration and information |
nstat | network | Network statistics and counters |
ss | sockets | Shows information about sockets |
systemd-analyze | performance | Performance and security analyzer of systemd components |
tcpdump | network sniffing | Monitors 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: