LFCS Networking Practice Question
A Linux server needs to resolve the hostname db.internal.example.com to an IP address. The administrator wants to query the DNS server directly without relying on the local resolver cache. Which command should be used?
⚠ Common exam trap
The trap here is assuming that any command that resolves a hostname queries DNS directly, when most use the system resolver and cache.
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
✓
dig db.internal.example.com
The dig command is the standard tool for querying DNS servers directly. It sends a DNS query and displays the response, bypassing local caching mechanisms like nscd or systemd-resolved. Other commands either rely on the system resolver, display local host information, or show configuration files without performing a lookup.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
hostname -f
Why it's wrong here
The hostname -f command displays the fully qualified domain name of the local host, not a query for an arbitrary remote hostname. It relies on local configuration and resolver settings. It cannot be used to look up db.internal.example.com, so it does not meet the requirement.
- ✗
ping db.internal.example.com
Why it's wrong here
Ping resolves the hostname using the system resolver, which may use cached results or /etc/hosts. It also sends ICMP packets, which may be blocked. While it can indicate resolution success, it does not query DNS directly and provides no DNS record details, making it unsuitable for a direct DNS query.
- ✓
dig db.internal.example.com
Why this is correct
The dig command queries DNS servers directly and displays the full response, including the answer, authority, and additional sections. It bypasses the local resolver cache by sending a query to the configured DNS server. This makes it ideal for troubleshooting DNS resolution for a specific hostname.
- ✗
cat /etc/resolv.conf
Why it's wrong here
Viewing /etc/resolv.conf shows which DNS servers are configured but does not perform a query. It provides no information about the IP address of db.internal.example.com. This command is useful for verifying resolver configuration but not for resolving a specific hostname.
Visual reference
Go deeper
Related to this question
About these practice questions
This LFCS question is part of Courseiva's 406-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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Linux Foundation exam blueprint
This LFCS practice question is part of Courseiva's free Linux Foundation 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 LFCS exam.