LPIC-2 Network Client Management Practice Question
Which TWO commands can be used to display the current DNS resolver configuration on a Linux system? (Select TWO.)
⚠ Common exam trap
It's easy for candidates to assume `cat /etc/resolv.conf` is always the authoritative source for DNS resolver configuration, but on modern systems with systemd-resolved or NetworkManager, this file may be dynamically generated or a stub, and the actual resolver state is better queried via `resolvectl status` or `nmcli dev show`.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
nmcli dev show
The `nmcli dev show` command displays network device details managed by NetworkManager, including DNS configuration. The `resolvectl status` command shows the current DNS resolver state for systemd-resolved. These two commands provide the actual current resolver configuration. The `cat /etc/resolv.conf` file may be manually edited or dynamically generated and does not necessarily reflect the current resolver state on systems using systemd-resolved or NetworkManager.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
dig localhost
Why it's wrong here
dig performs DNS lookups, it does not display configuration.
- ✓
nmcli dev show
Why this is correct
Correct. It shows DNS settings from NetworkManager.
- ✓
resolvectl status
Why this is correct
Correct. It shows the current resolver state from systemd-resolved.
- ✗
nslookup
Why it's wrong here
nslookup performs DNS lookups, it does not display configuration.
- ✗
cat /etc/resolv.conf
Why it's wrong here
Incorrect. It shows the contents of a static or generated file, which may not reflect the current resolver configuration on modern systems.
Visual reference
Go deeper
Related to this question
About these practice questions
This LPIC-2 question is part of Courseiva's 507-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LPIC-2 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-2 exam.