Explore how the systemd-resolved client `resolvectl` lets you inspect and control DNS resolution directly from the shell. 23.06.2026 | reading time: 2 min When a name does not resolve or a new DNS server must be tested, `resolvectl` is the hands-on tool that talks to systemd-resolved; learn to query names, inspect per-interface servers and clear caches from the command line. Hands-on query and status Try this quick session to see `resolvectl` in action: ```resolvectl query example.com example.com: 93.184.216.34 -- Information acquired via DNSSEC: no resolvectl status Global DNS Servers: 1.1.1.1 Link 2 (eth0) Current Scopes: DNS DNS Servers: 192.168.1.1 ``` This shows a direct DNS lookup result and a condensed resolver status for global and per-interface settings. Powerful actions you can run Use `resolvectl status` to inspect resolver state, `resolvectl query` to resolve names and types, `resolvectl flush-caches` to clear systemd-resolved caches, and `resolvectl set-dns` or `resolvectl set-domain` to assign per-interface DNS servers and search domains for testing and troubleshooting. Complementary troubleshooting tools When deeper investigation is required, combine `resolvectl` with packet captures and classic resolver tools to correlate behavior and timing, and always compare results from the system resolver and a direct DNS query to isolate caching or configuration issues. Practical tips and caveats Remember that `resolvectl` talks to systemd-resolved, so it shows and changes the resolver state managed by that service only; in distributions using other resolvers or where systemd-resolved is disabled, these commands will not affect DNS resolution. Next steps Experiment by switching per-interface DNS servers and flushing caches to see how responses change, then combine that practice with network and debugging tools to build solid DNS troubleshooting skills. Join Bits & Bytes Academy First class LINUX exam preparation. network utilities troubleshooting