On a system using systemd-resolved, list global and per-link DNS servers, search domains, and protocol status.
Do not change the configuration.
Which command is appropriate?
resolvectl status displays current resolver servers, per-link settings, domains, and DNSSEC-related state.
Detailed explanation
resolvectl dns enp1s0 192.0.2.53Incorrect. It changes the per-link DNS server.
Incorrect. It changes the per-link DNS server.
resolvectl revert enp1s0Incorrect. It restores the per-link configuration to defaults.
Incorrect. It restores the per-link configuration to defaults.
resolvectl statusCorrect. It displays global and per-link resolver state.
Correct. It displays global and per-link resolver state.
resolvectl flush-cachesIncorrect. It clears the local DNS cache.
Incorrect. It clears the local DNS cache.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' 'resolvectl status -> global and per-link DNS state'Expected result
resolvectl status -> global and per-link DNS stateKey points
- status is read-only
- Inspect per-link DNS
- Separate from dns, revert, and flush
Notes
- Environment: systemd resolvectlの操作対応表
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.