Courseiva
Service Configuration →hardMultiple Choice

LFCS Service Configuration Practice Question

A Linux administrator is configuring a systemd service that must only start after the network is fully online and must stop if the network goes down. The unit file currently has After=network.target. However, the service sometimes starts before DNS resolution is available, causing failures. Which target should the administrator use instead to ensure the network is fully configured and DNS is available?

⚠ Common exam trap

Candidates often confuse network.target with network-online.target; the former only indicates the network stack is up, while the latter waits for actual connectivity.

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

✓

network-online.target

network-online.target is designed specifically to wait until the network is fully operational, including DNS resolution. By using After=network-online.target and Wants=network-online.target, the service will not start until the network is truly online. This is the correct target for services that require actual network connectivity, unlike network.target which only signals that the network stack has started.

Answer analysis

Option-by-option breakdown

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

  • ✗

    network.target

    Why it's wrong here

    network.target indicates that the network management stack has been started, but it does not guarantee that interfaces are configured or that DNS is reachable. Services that require actual network connectivity should not rely solely on network.target. This is why the service sometimes starts before DNS is available.

  • ✗

    multi-user.target

    Why it's wrong here

    multi-user.target is a general system state for multi-user operation, not a network readiness indicator. It may be reached before the network is fully online. Using it as a dependency does not provide any guarantee about network availability, so it would not solve the premature start problem.

  • ✗

    basic.target

    Why it's wrong here

    basic.target is an early boot target that includes basic system services like sockets and timers, but it has no relationship to network readiness. It is typically pulled in very early and does not wait for network configuration. It would be an inappropriate dependency for a service requiring DNS.

  • ✓

    network-online.target

    Why this is correct

    network-online.target is a special target that waits until the network is actually configured and reachable, not just the network management stack started. Using After=network-online.target and Wants=network-online.target ensures the service starts only after the network is online, which includes DNS resolution. This directly addresses the premature start issue.

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 LFCS question is part of Courseiva's 406-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 and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Linux Foundation exam blueprint

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.