resolvectl
resolvectl shows the information related to name resolution coming from the resolve daemonInstallation
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
Short option | Long option | Description |
---|---|---|
-i IFACE | --interface=IFACE | Define interface to be used together with a DNS query |
-t TYPE | --type=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
Relevant articles using the resolvectl command
The following articles include an example on how to use resolvectl and might be worth further exploring.