Skip to content

DNS Client under linux

How-to Flush the DNS Cache on Linux

To flush DNS cache root access is required.

sudo systemd-resolve --flush-caches

You can then check the statistics in order to make sure that your cache size is now zero, thus cleared.

systemd-resolve --statistics

If systemd is not available on your system try

sudo service dns-clean restart

or (this should be exactly the same)

sudo /etc/init.d/dns-clean restart

How-to see DNS you use

systemd-resolve --status