LPIC-2 Network Client Management Practice Question
An administrator needs to configure a Linux client to automatically obtain an IP address from a DHCP server but also ensure that the client uses a specific static DNS server (8.8.8.8) regardless of the DHCP-provided DNS. Which configuration should be applied?
⚠ Common exam trap
Many candidates confuse `prepend` (which adds a DNS server but does not remove DHCP-provided ones) with `supersede` (which completely replaces the DHCP-provided list), leading them to choose option C instead of D.
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
✓
Add 'supersede domain-name-servers 8.8.8.8;' to /etc/dhcp/dhclient.conf
The `supersede` directive in `/etc/dhcp/dhclient.conf` forces the DHCP client to replace any DNS server addresses received from the DHCP server with the specified value (8.8.8.8). This ensures the client uses the static DNS server regardless of what the DHCP server offers, while still obtaining its IP address dynamically.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Add 'append domain-name-servers 8.8.8.8;' to /etc/dhcp/dhclient.conf
Why it's wrong here
append adds the DNS server after DHCP-provided ones, so the client may use both.
- ✗
Edit /etc/sysconfig/network-scripts/ifcfg-eth0 and set PEERDNS=no and DNS1=8.8.8.8
Why it's wrong here
This is distribution-specific and not universal; also it may not override DHCP if not properly configured.
- ✗
Add 'prepend domain-name-servers 8.8.8.8;' to /etc/dhcp/dhclient.conf
Why it's wrong here
prepend adds the DNS server before DHCP-provided ones but does not override; the DHCP-provided servers might still be used.
- ✓
Add 'supersede domain-name-servers 8.8.8.8;' to /etc/dhcp/dhclient.conf
Why this is correct
supersede overrides the DHCP-provided DNS servers with the specified one.
Visual reference
Go deeper
Related to this question
About these practice questions
Courseiva writes every LPIC-2 question from scratch — 507 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
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.