DNS caching involves an Operating System (OS) or a browser capturing recently-visited IP addresses and saving them for loading pages more quickly. When DNS settings are updated, clearing the devices’ DNS cache helps you make the devices recognize the updated information faster.
The instructions on this guide provide directions for clearing the DNS cache on computers and servers.
In order to flush your DNS in a Windows device, open a command prompt window and type:
You should receive the following confirmation message:
macOS version 10.5 or 10.6
If the command is executed successfully, the system will not return any output.
macOS version 10.7+
To clear the DNS cache in a macOS version 10.7 and above, follow the steps below:
If the command is executed successfully, the system will not return any output.
To flush the DNS cache in most Ubuntu and other Debian-based distributions, open a terminal (gnome-terminal, konsole, xterm, etc.) and run the following command:
If the command is executed successfully, the system will not return any output.
For different distributions, check if it is using nscd, dnsmasq, or other packages and search how to clear the DNS cache with those tools. For example, usually Red Hat distributions and Arch Linux use nscd to restart the service to clear out the cache: