Courseiva
Essential System Services and NetworkinghardMultiple ChoiceObjective-mapped

LPIC-1 Essential System Services and Networking Practice Question

A server in a corporate network uses systemd-resolved for DNS. Internal hostnames (e.g., server.example.lan) fail to resolve, but external names (e.g., google.com) work. The /etc/resolv.conf is a symlink to /run/systemd/resolve/stub-resolv.conf. The administrator checks the systemd-resolved configuration and finds that the internal DNS server is listed globally, but the network interface has no specific DNS set. Which command should be used to assign the internal DNS server to the interface and fix resolution?

⚠ Common exam trap

It's easy for candidates to assume editing /etc/resolv.conf or restarting the service will fix the issue, but they fail to recognize that systemd-resolved requires explicit per-interface DNS assignment via `resolvectl` to override the global setting for a specific network interface.

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

Run 'resolvectl dns eth0 10.0.0.1' to set the DNS server for the interface.

`resolvectl dns eth0 10.0.0.1` assigns the internal DNS server specifically to the network interface (eth0), overriding the global setting for that interface. In systemd-resolved, per-interface DNS settings take precedence over global DNS servers, so this command ensures that internal hostnames are resolved by the internal DNS server while external names continue to work via the global configuration.

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 the internal hostnames to /etc/hosts.

    Why it's wrong here

    This is a static workaround and not a proper fix for dynamic resolution.

  • Run 'resolvectl dns eth0 10.0.0.1' to set the DNS server for the interface.

    Why this is correct

    This sets the per-link DNS, allowing systemd-resolved to use the internal server for that interface.

  • Restart systemd-resolved service.

    Why it's wrong here

    Restarting does not change the per-link DNS configuration.

  • Edit /etc/resolv.conf and add the internal DNS server.

    Why it's wrong here

    The file is managed by systemd-resolved; manual changes will be overwritten.

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

This LPIC-1 question is part of Courseiva's 527-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 →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This LPIC-1 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-1 exam.