To flush the DNS cache on a Linux or Unix system, you can use the systemd-resolve
command.
To flush the DNS cache, use the following command:
systemd-resolve --flush-cachesSource:www.lautturi.com
This will clear the DNS cache and remove all entries.
If you are using a version of Linux that does not use systemd
, you can use the nscd
(Name Service Caching Daemon) command to flush the DNS cache.
To flush the DNS cache using nscd
, use the following command:
nscd -i hosts
This will clear the DNS cache and remove all entries.
It's always a good idea to carefully review the documentation and use the appropriate commands to flush the DNS cache on your system. This can be useful in troubleshooting DNS issues or when you need to refresh the DNS cache to pick up changes to DNS records.