Resolve app.example.test through systemd-resolved and display the result with protocol and interface details.
Which command is appropriate?
resolvectl query NAME asks systemd-resolved to resolve the name and reports the result and route used.
Detailed explanation
resolvectl status app.example.testIncorrect. status displays resolver state rather than querying a name.
Incorrect. status displays resolver state rather than querying a name.
resolvectl dns app.example.testIncorrect. dns configures a link's DNS server addresses.
Incorrect. dns configures a link's DNS server addresses.
resolvectl domain app.example.testIncorrect. domain configures search or routing domains.
Incorrect. domain configures search or routing domains.
resolvectl query app.example.testCorrect. It requests name resolution through systemd-resolved.
Correct. It requests name resolution through systemd-resolved.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' 'resolvectl query NAME -> resolved addresses and lookup metadata'Expected result
resolvectl query NAME -> resolved addresses and lookup metadataKey points
- Use the query subcommand
- Go through resolved
- Distinguish status, dns, and domain
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.