Courseiva
NetworkingmediumMultiple ChoiceObjective-mapped

LFCS Networking Practice Question

A Linux system administrator is troubleshooting a DNS resolution issue on a Ubuntu 20.04 server. The server is configured with a static IP address on interface eth0 via /etc/netplan/01-netcfg.yaml. The administrator set the DNS servers to 8.8.8.8 and 8.8.4.4 in the cloud-config file. After applying the netplan configuration, the server can resolve hostnames correctly. However, after a few days, users report that the server can no longer resolve external hostnames. The administrator checks /etc/resolv.conf and sees that it contains only a local DNS server (127.0.0.53) and no references to the public DNS servers. The administrator wants to ensure that the public DNS servers are always used and that local DNS is bypassed. What is the best course of action?

⚠ Common exam trap

Many candidates think directly editing /etc/resolv.conf or disabling systemd-resolved is a valid fix, but they fail to understand that netplan and systemd-resolved work together to manage DNS, and the proper way to bypass the local stub is to configure the upstream servers correctly in netplan with DHCP overrides disabled.

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

Modify the netplan configuration to set dns servers and set 'dhcp4-overrides: {use-dns: false}' then apply.

In Ubuntu 20.04, netplan uses systemd-resolved by default, which listens on 127.0.0.53. Setting 'dhcp4-overrides: {use-dns: false}' in the netplan configuration prevents DHCP from overriding the manually specified DNS servers, ensuring that only the public DNS servers (8.8.8.8 and 8.8.4.4) are used for resolution. After applying with 'netplan apply', systemd-resolved will forward queries to those public servers, bypassing the local stub resolver.

Answer analysis

Option-by-option breakdown

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

  • Modify the netplan configuration to set dns servers and set 'dhcp4-overrides: {use-dns: false}' then apply.

    Why this is correct

    This ensures netplan configures systemd-resolved to use the specified DNS servers.

  • Directly edit /etc/resolv.conf to add the public DNS servers and make it immutable using chattr +i.

    Why it's wrong here

    systemd-resolved will still overwrite or ignore the file.

  • Use the 'host' command to force DNS queries to use a specific server.

    Why it's wrong here

    The 'host' command is a diagnostic tool, not a persistent fix.

  • Stop and disable the systemd-resolved service using systemctl.

    Why it's wrong here

    Disabling systemd-resolved may cause other DNS resolution issues.

Visual reference

Client DHCP Server 1 Discover (broadcast) 2 Offer (IP: 192.168.1.10) 3 Request (I accept) 4 Acknowledge (lease confirmed) DORA — the four-step DHCP lease process

About these practice questions

One of 507 original LFCS 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 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.