Courseiva
Network Client ManagementeasyMultiple ChoiceObjective-mapped

LPIC-2 Network Client Management Practice Question

A system administrator needs to configure a Linux client to use a specific DNS server for a particular domain. Which file should be modified to achieve this?

⚠ Common exam trap

A common mix-up: candidates confuse /etc/resolv.conf with /etc/nsswitch.conf, thinking the latter controls DNS server selection, when in fact nsswitch.conf only defines the lookup order (e.g., files before dns) and not the actual DNS server addresses.

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

Edit /etc/resolv.conf

The /etc/resolv.conf file is the primary configuration file for DNS resolution on Linux systems. It allows specifying DNS servers (nameserver entries) and search domains, and can be configured to use a specific DNS server for a particular domain by adding a 'domain' or 'search' directive along with the appropriate nameserver. This file is read by the resolver library (glibc) during DNS lookups.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Edit /etc/hosts

    Why it's wrong here

    hosts file is for static IP-to-hostname mappings, not DNS server configuration.

  • Edit /etc/networks

    Why it's wrong here

    networks file is for mapping network names to network numbers, not DNS configuration.

  • Edit /etc/nsswitch.conf

    Why it's wrong here

    nsswitch.conf controls the order of name resolution services, not DNS server configuration for a specific domain.

  • Edit /etc/resolv.conf

    Why this is correct

    resolv.conf contains DNS server IPs and domain/search directives to specify default domains.

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 507 original LPIC-2 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 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.