Courseiva
Networking →easyMultiple Choice

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

    Hostname resolution relies on the DNS servers listed in /etc/resolv.conf; reaching the server by IP proves network connectivity is fine. A missing or incorrect nameserver entry there prevents the resolver from translating the hostname, matching the stem's symptom exactly.

  • ✗

    /etc/sysconfig/network

    Why it's wrong here

    /etc/sysconfig/network holds hostname and gateway settings, not resolver configuration, so it cannot cause hostname-only resolution failure. It is tempting because it is a network configuration file, and would be correct if the default gateway or static hostname were misconfigured.

  • ✗

    /etc/hosts

    Why it's wrong here

    A stale or incorrect entry in /etc/hosts would override DNS and break resolution for that specific hostname, but the stem gives no evidence of a local override. It is tempting because hosts entries are a common cause, and would be correct if only one hostname failed while others resolved.

  • ✗

    /etc/nsswitch.conf

    Why it's wrong here

    nsswitch.conf orders name-service lookups; a misordering there would still fall through to DNS, so it rarely causes total hostname failure. It is tempting because it governs resolution sources, and would be the answer if local files were consulted before DNS and returned stale entries.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

One of 406 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 →

How Courseiva writes practice questions · Editorial policy

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.