Skip to the content.

Fedora DNS Cache for Offline Resilience

Configure systemd-resolved to serve stale (expired) DNS cache entries when upstream DNS servers are unreachable, preventing 30+ second hangs in terminals and shells caused by DNS resolution timeouts.

Problem

When an ISP connection drops or DNS servers become unreachable, every DNS lookup (hostname resolution, SSSD/IPA checks, etc.) blocks for 30+ seconds waiting for a timeout. This makes GNOME Terminal appear stuck — the window opens but no prompt appears until all pending DNS queries time out.

Solution

Enable StaleRetentionSec in systemd-resolved. When upstream DNS is unreachable, previously cached answers are served immediately (for up to 1 hour after expiry) instead of waiting for a timeout.

Rules

Do NOT fabricate or invent command output, status, or results. Every report MUST come from actual script or command execution. If a command fails, report the actual error — do not guess.

Do NOT skip steps or combine multiple operations into one step. Execute each step in order and verify before proceeding.

Prerequisites

Do NOT fabricate or invent command output, status, or results. Every report MUST come from actual script or command execution. If a command fails, report the actual error — do not guess.

Do NOT skip steps or combine multiple operations into one step. Execute each step in order and verify before proceeding.

Workflow

Step 1 — Run the setup script

The agent MUST run the setup script:

bash ~/.agents/skills/fedora-dns-cache/scripts/setup.sh

The script handles diagnosis, configuration, and service restart automatically. It requires sudo for systemd config changes. The agent MUST report the script output verbatim.

Step 2 — Verify

The agent MUST confirm the configuration is active:

systemd-analyze cat-config systemd/resolved.conf | grep -i stale

Expected: StaleRetentionSec=3600 (uncommented).

Output Contract

How It Works

Verification

Changelog

See CHANGELOG.md for version history.