How to delete dns cache from my computer?
Recently UpdatedQuestion: How can I clear the local dns cache stored by my computer?
- What is dns cache?
As soon as we ask our browser to open a website, an immediate query is made to the nameserver of our operating system.
This function occurs with anything installed on our computer that needs an internet connection to work.
The nameserver will respond with the IP address of the website we requested, and it will appear in our browser.
After this happens, the operating system remembers this response and stores it in its temporary memory.
When we ask to view the same website again after a few days or hours, our computer will not make a direct query to the nameserver.
Since it is stored in the temporary memory of our computer, to save us time and bring us the page we requested faster, it will use the information it already has.
This method is called dns caching.
We may need to clear the dns cache of our computer in cases where a website does not open correctly or we know that a recent change has been made to the dns but our computer has not received the new dns information.
- How do I clear my computer's dns cache?
The process is very simple
For Windows:
We press the Start button and search for the command prompt
After the program opens, we type
ipconfig /flushdns
and press Enter.
Immediately, a message will appear that the dns cache has been deleted.
For MacOS
We open the Finder and click on Applications. We find the Utilities and open them.
We open the terminal.
The terminal can also be opened via the launchpad by searching for "terminal"
In the new terminal window, depending on the Mac version we have, we type:
- For 10.7-10.9, 10.11-10.14 (Lion, Mountain Lion, Mavericks, El Capitan, Sierra, High Sierra, Mojave):
$ sudo killall -HUP mDNSResponder
For 10.10 (Yosemite):
$ sudo discoveryutil mdnsflushcache
For 10.5-10.6 (Leopard, Snow Leopard):
sudo dscacheutil -flushcache
For 10.4 (Tiger):
lookupd -flushcache
We press Enter and it will display a message that the dns cache has been deleted.