Via Cà Matta 2 - Peschiera Borromeo (MI)
+39 02 00704272

How to clear DNS cache on Ubuntu

How to clear DNS cache on Ubuntu

Operating systems such as Windows automatically create temporary records on all websites visited in the so-called DNS cache. The information contained is valid for a limited period of time. A DNS flush, i.e. a flushing of the cache, removes data from the system before the time limit expires.

For clear DNS

To clear DNS cache open the terminal and type (until Ubuntu 18.04):

else from Ubuntu 20.04:


Type this another command:

The statistics will be displayed in the terminal. If you see that the “current cache size” is zero, you will get confirmation that your DNS cache has been cleared.