Windows ipconfig /flushdns equivalent in Linux
Clears locally cached DNS records, forcing fresh lookups on the next DNS request.
ipconfig /flushdns
sudo resolvectl flush-caches
sudo resolvectl flush-caches
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.
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.
For the broader concept behind this mapping, read Linux networking for Windows users.
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 option | Use |
|---|---|
systemd-resolve --flush-caches | Flush DNS (systemd-resolved) |
resolvectl flush-caches | Alternative on newer systems |
sudo systemctl restart systemd-resolved | Restart DNS resolver service |
resolvectl status | View current DNS servers per interface |
cat /etc/resolv.conf | View 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.
| Distribution | Package manager / base | Equivalent command | Difference 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