LPIC-2 Advanced Networking Configuration Practice Question
A small office network uses a Linux server running dnsmasq to provide DHCP and DNS services. The server runs Ubuntu with dnsmasq version 2.80. The configuration file /etc/dnsmasq.conf includes: 'interface=eth0', 'dhcp-range=192.168.1.100,192.168.1.200,12h', and no other DNS-related options. Clients receive IP addresses from the DHCP server and can access the internet. However, clients cannot ping other clients by hostname (e.g., 'ping workstation1' fails with NXDOMAIN). The dnsmasq logs show that DHCP requests are handled and the client hostnames are recorded. The administrator verifies that /etc/hosts contains only the localhost entry. Which of the following is the most likely cause?
⚠ Common exam trap
Candidates often assume DHCP hostnames are automatically resolvable via DNS, but dnsmasq requires explicit configuration (like 'local' or 'domain') to enable this, and they may incorrectly attribute the issue to 'expand-hosts' or 'domain-needed' instead.
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
✓
The dnsmasq 'local' directive is not configured to treat local hostnames as authoritative.
Without the 'local' directive (or equivalent '--local' / 'localise-queries'), dnsmasq does not treat hostnames from DHCP leases as authoritative for DNS resolution. By default, dnsmasq only answers queries for names it knows from /etc/hosts or from upstream DNS, but it does not automatically resolve DHCP client hostnames unless explicitly told to do so via 'local' or 'domain' settings. Since the logs show hostnames are recorded but NXDOMAIN is returned, the missing 'local' directive is the most likely cause.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The dnsmasq 'local' directive is not configured to treat local hostnames as authoritative.
Why this is correct
Without a local domain definition, dnsmasq forwards single-label queries upstream.
- ✗
The dnsmasq 'expand-hosts' option is not enabled.
Why it's wrong here
expand-hosts adds domains to /etc/hosts entries, but not to DHCP leases.
- ✗
The dnsmasq 'domain-needed' option is set, blocking local domain resolution.
Why it's wrong here
domain-needed would actually help resolve local names by not forwarding them, so it is not the cause.
- ✗
The dnsmasq 'no-hosts' option is configured, ignoring /etc/hosts.
Why it's wrong here
The configuration does not include 'no-hosts'.
Visual reference
Go deeper
Related to this question
About these practice questions
This LPIC-2 question is part of Courseiva's 507-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.