LFCS Networking Practice Question
Which TWO configuration files are commonly used to set DNS resolver settings on a Linux system?
⚠ Common exam trap
Test-takers frequently confuse /etc/hosts with a DNS resolver configuration file, but it is only a static local lookup table, not a resolver setting file.
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/nsswitch.conf
/etc/nsswitch.conf controls the order of name resolution sources (e.g., files, dns, mdns) via the 'hosts' database line. Option E is correct because /etc/resolv.conf directly specifies the DNS resolver settings, including nameserver IP addresses, search domains, and options, as defined by RFC 1035.
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/nsswitch.conf
Why this is correct
Controls order of name resolution (e.g., files, dns).
- ✗
/etc/hostname
Why it's wrong here
Sets the hostname only.
- ✗
/etc/sysconfig/network
Why it's wrong here
Contains general network settings, not DNS resolver.
- ✗
/etc/hosts
Why it's wrong here
Contains static hostname mappings.
- ✓
/etc/resolv.conf
Why this is correct
Contains nameserver and search domain settings.
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.