resolvectl statistics
returns:
DNSSEC supported by current servers: no Transactions Current Transactions: 0 Total Transactions: 3554 Cache Current Cache Size: 0 Cache Hits: 13 Cache Misses: 84731 DNSSEC Verdicts Secure: 0 Insecure: 0 Bogus: 0 Indeterminate: 0
resolvectl flush-caches
NOTE: This should reduce the Cache Size entry reset to 0.
sudo systemd-resolve --flush-caches
Check the statistics in order to make sure that your cache size is now zero, thus cleared:
sudo systemd-resolve --statistics
returns:
DNSSEC supported by current servers: no Transactions Current Transactions: 0 Total Transactions: 169902 Cache Current Cache Size: 39 Cache Hits: 162 Cache Misses: 190 DNSSEC Verdicts Secure: 0 Insecure: 0 Bogus: 0 Indeterminate: 0