I've already tried sudo systemd-resolve --flush-caches but it ends up showing sudo: systemd-resolve: command not found. So, how do I flush the DNS cache in Ubuntu 22?

1 Answer 1


22.04 no longer comes with systemd-resolv and it is not installable by any packages that I can see in the default repos. An apt-cache search systemd-resolve shows that it is in the resolvconf-admin package, but when I tried installing that package it did not install systemd-resolve.

22.04 comes with resolvectl instead.

You can use the following command to flush your caches:

sudo resolvectl flush-caches

Hope this helps!

  • 3
    It definitely did help me :) Commented Sep 29, 2022 at 15:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .