AI Crawler · Collection Records

Bot summary · Last 24 hours

resolvectl — systemd DNS status check

Checks and manages the DNS settings and cache of systemd-resolved. Used instead of /etc/resolv.conf.
Markdown source·Anything to add or correct?

💬 "resolvectl Command"

The resolvectl command is a systemd DNS state checker for checking and managing the DNS settings and cache of systemd-resolved. It is used instead of /etc/resolv.conf.

It checks DNS servers and search domains per interface. DNS cache lookup and flushing is possible.

  • Concept: Checks DNS servers and search domains per interface.
  • Key Features: DNS cache lookup and flushing is possible.
  • Advantage: Checks DNSSEC validation status.
  • Usage: Manages DNS-over-TLS settings.

Installation and Download

The resolvectl package is installed via a package manager or an official script.

EnvironmentCommand
Built-in with systemd (235+)resolvectl status
Older versions (below 235)Uses the name systemd-resolve
Activationsudo systemctl enable --now systemd-resolved
Verificationresolvectl --version

Installation is verified with resolvectl --version.

Commonly Used Options

OptionDescription
resolvectl statusDisplays the entire current DNS configuration
resolvectl query <domain>Queries DNS for a specific domain
resolvectl flush-cachesFlushes the DNS cache
resolvectl statisticsDisplays DNS query statistics
resolvectl revert <iface>Reverts the DNS settings for an interface

Top 3 Essential Command Combinations

  • resolvectl status — Check which DNS server is being used
  • resolvectl query example.com — Trace the DNS resolution path
  • resolvectl flush-caches — Resolve cache-related issues

💬 "Show me an example of using resolvectl on a real server"

Here is a step-by-step summary of common situations encountered on production servers.

Step 1: Verify Installation

Check the active status of systemd-resolved.


resolvectl --version && systemctl status systemd-resolved

Step 2: Check DNS Configuration

Check the current DNS servers.


resolvectl status

Step 3: Test Resolution

Check the resolution for a specific domain.


resolvectl query example.com

Actual Execution Screen

This is the result of checking the current DNS configuration with resolvectl status.

!resolvectl command execution result

Production server

How It Is Used in Practice

1. Tracing DNS Paths

Situation — Finding the cause when a specific domain fails to resolve.


resolvectl query example.com

Result — Shows which DNS server responded and which link's configuration was involved.

Key Point — This information cannot be obtained by just looking at /etc/resolv.conf.

2. Cache Flushing

Situation — Flushing the cache when DNS resolution is intermittent.


resolvectl flush-caches && resolvectl query example.com

Result — The cache is cleared, and a new resolution is attempted.

Key Point — Be cautious of sudden traffic spikes during operating hours.

Actual Execution Screen

This is the result of checking resolution and statistics with resolvectl query and statistics.

!resolvectl command execution result 2

Production server

Points of Caution

  • If systemd-resolved is disabled, resolvectl will not work.
  • On older versions (below 235), the command name is systemd-resolve.
  • flush-caches invalidates the DNS cache for all clients. Exercise caution during operating hours.

Source (HTML): https://games.aidebatehub.com/programs/linux/network/resolvectl.html This file is an auto-generated Markdown twin of the DevHub document.

Visitor Comments

Loading…
💬 Comments: 0 · Author type: human | Built: 2026-10-30T20:30:59+09:00