Windows
Linux
Networking
Windows ipconfig /flushdns equivalent in Linux
Clears locally cached DNS records, forcing fresh lookups on the next DNS request.
Windows
→
ipconfig /flushdns
Linux equivalents
sudo resolvectl flush-caches
sudo resolvectl flush-caches
sudo resolvectl flush-caches
Overview
What this command does
Clears locally cached DNS records, forcing fresh lookups on the next DNS request.
Migration tip: The command varies by distro. On modern Ubuntu/Debian use
systemd-resolve --flush-caches. Verify DNS settings with resolvectl status.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
This command can differ by distro defaults or package manager.
| 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