LFCS Networking Practice Question
A user reports that they cannot reach a remote server by hostname but can reach it by IP address. Which configuration file is most likely misconfigured?
⚠ Common exam trap
Many candidates confuse /etc/resolv.conf with /etc/hosts or /etc/nsswitch.conf, thinking that a hostname resolution failure must be due to a missing static entry or a misconfigured lookup order, rather than the fundamental DNS resolver configuration.
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
✓
/etc/resolv.conf
The /etc/resolv.conf file configures the system's DNS resolver, specifying the nameservers to query for hostname-to-IP resolution. If a user can reach a server by IP but not by hostname, it indicates that DNS resolution is failing, which is most commonly due to a missing or incorrect nameserver entry in /etc/resolv.conf.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
/etc/resolv.conf
Why this is correct
/etc/resolv.conf specifies DNS servers; if misconfigured, DNS queries fail, causing hostname resolution to fail.
- ✗
/etc/sysconfig/network
Why it's wrong here
This file is not used on most modern distributions; it is deprecated in favor of /etc/sysconfig/network-scripts on RHEL-based systems but not directly related to DNS resolution.
- ✗
/etc/hosts
Why it's wrong here
/etc/hosts provides static hostname-to-IP mappings; if it were the sole issue, the hostname might resolve or not, but with DNS failure, this file is not the primary cause.
- ✗
/etc/nsswitch.conf
Why it's wrong here
/etc/nsswitch.conf controls the order of name resolution sources but does not configure DNS servers directly.
Visual reference
Go deeper
Related to this question
About these practice questions
One of 507 original LFCS practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.