← All commands
Topic hub Networking
Windows Linux Networking Expanded guide

Windows ipconfig /flushdns equivalent in Linux

Clears locally cached DNS records, forcing fresh lookups on the next DNS request.

Windows ipconfig /flushdns
→
Linux equivalents
Debian/Ubuntu apt / systemd-resolved
sudo resolvectl flush-caches
Fedora dnf / systemd-resolved
sudo resolvectl flush-caches
Arch pacman / systemd-resolved
sudo resolvectl flush-caches

Overview

What this command does

On Windows, "ipconfig /flushdns" is used to flush the DNS resolver cache. On Linux, the closest practical mapping shown here is "systemd-resolve --flush-caches". Clears locally cached DNS records, forcing fresh lookups on the next DNS request. This reference is grouped under Networking.

Migration tip: The command varies by distro. On modern Ubuntu/Debian use <code>systemd-resolve --flush-caches</code>. Verify DNS settings with <code>resolvectl status</code>.

Windows → Linux context

What changes when you use this on Linux?

Equivalent task, different tool

Windows ipconfig /flushdns maps to sudo resolvectl flush-caches for this task. Treat this as a workflow mapping rather than a character-for-character syntax translation.

Portable across the compared distros

The Debian/Ubuntu, Fedora and Arch rows use the same command in this mapping. Package availability or defaults can still vary, so check the installed tool version when an option behaves differently.

Elevated privilege appears in this workflow

At least one example uses sudo. Confirm the target path, device, service or package before running the elevated form; do not add sudo simply to bypass an unexplained permission error.

Practical tasks

Common use cases

Flush the DNS resolver cache

Clears locally cached DNS records, forcing fresh lookups on the next DNS request.

systemd-resolve --flush-caches

Flush DNS (systemd-resolved)

resolvectl flush-caches

Alternative on newer systems

sudo systemctl restart systemd-resolved

Restart DNS resolver service

Ready to run

Copyable Linux commands

Review paths, device names, package names and permissions before running any command.

sudo systemd-resolve --flush-caches
resolvectl flush-caches
resolvectl status
cat /etc/resolv.conf

Walkthrough

Examples with explanations

# Windows: ipconfig /flushdns

# Modern Ubuntu/Debian:
sudo systemd-resolve --flush-caches
resolvectl flush-caches  # alternative

# Check DNS settings:
resolvectl status
cat /etc/resolv.conf

Reference

Common options and variations

Command or optionUse
systemd-resolve --flush-cachesFlush DNS (systemd-resolved)
resolvectl flush-cachesAlternative on newer systems
sudo systemctl restart systemd-resolvedRestart DNS resolver service
resolvectl statusView current DNS servers per interface
cat /etc/resolv.confView DNS config file

Distro differences

Debian/Ubuntu vs Fedora vs Arch

The command "sudo resolvectl flush-caches" is the same in all three rows, while package or base details differ: Debian/Ubuntu uses apt / systemd-resolved; Fedora uses dnf / systemd-resolved; Arch uses pacman / systemd-resolved.

DistributionPackage manager / baseEquivalent commandDifference to notice
Debian/Ubuntu apt / systemd-resolved sudo resolvectl flush-caches Works when systemd-resolved is handling DNS cache.
Fedora dnf / systemd-resolved sudo resolvectl flush-caches Fedora systems may use systemd-resolved depending on edition/configuration.
Arch pacman / systemd-resolved sudo resolvectl flush-caches Only applies if systemd-resolved is enabled; otherwise flush the cache daemon you installed.

Keep learning

Related Networking commands