Bash Clear DNS Cache
In Bash, you can clear the DNS cache by flushing the system resolver cache. Here are the steps to clear the DNS cache in Bash:
- Open a terminal window and type the following command to clear the cache:
sudo systemd-resolve --flush-cachesThis command will flush the DNS cache and any other caches that may be used by the resolver.
- Verify that the cache has been cleared by running the following command:
sudo systemd-resolve --statisticsThis command will display statistics for the current DNS cache. If the cache has been cleared, the output should show that the cache is empty.
