The temporary μνήμη DNS (DNS cache) είναι μια προσωρινή βάση δεδομένων σε ένα λειτουργικό σύστημα που αποθηκεύει όλες τις DNS αναζητήσεις που πραγματοποιείτε (information from the websites you have visited and domains).
Its mode of operation is quite simple:
When you visit a site multiple times, your operating system stores the site information in the local cache. So instead of having to send DNS queries to an external DNS server each time, it receives them locally from the DNS cache. That's why loading these sites is so much faster.
However, there are times when DNS cache can be corrupted. You may also notice that if a site changes, your browser insists on loading the old (cached) version of the site.
When that happens, what do you do? You are emptying the DNS cache into your operating system. Once the DNS cache is empty, the initial loading of the sites will be slightly slower, but it will be correct. Once a page's DNS is saved again it will regain the speed you knew.
How to clear DNS cache depends on your operating system. Let's see how you can clear the DNS cache in their operating system Windows but also on Linux.
Windows:
Look up the term cmd. The black command line icon will appear. Copy - paste the following command and press enter
ipconfig / flushdns
That's it.
Linux:
You will need a Linux distribution that uses systemd and a user with sudo privileges. This same process will work with both Debian-Ubuntu-based distributions and Red Hat-based distributions.
Make sure you are running systemd. To do this, open a terminal and give the command:
sudo systemctl is-active systemd-resolved
You should see:
active
Let's clear the memory
sudo systemd-resolve --flush-caches
Warning
If you are using a Red Hat-based distribution other than CentOS, you may find that the systemd-resolve command does not work. In this case, you will need to try one of the following commands to clear the DNS cache:
sudo systemctl restart nscd.service
THE:
sudo systemctl restart named
Debian
In case the order
sudo systemd-resolve --flush-caches
gives you the following message
run the following command:
sudo systemctl enable systemd-resolved.service
Then try running the first command again:
systemd-resolve –flush-caches
To verify that the values are zero run the following command
sudo systemd-resolve --statistics