What is DNS cache
Caching is the storing of information in a server for a quicker retrieval. Complete DNS lookup requires the passage and exchange of information between multiple machines. DNS cache is the storing of previous DNS lookups on an operating system or a browser. This is done so that retrieval of an IP address is quick and efficient.
When should DNS cache be flushed
Here are some instances when you may need to flush your DNS cache.
- The website has been updated but you are seeing an old version
- DNS has been resolved but your not seeing it on your system
- You are getting error messages
- You want to update any changes made to your DNS records
You can flush your DNS cache in the case of all of the above. When you flush the DNS cache, you will trigger a complete DNS lookup. This means that if you have any old data, old server DNS, or corrupted DNS servers, all of that data will be deleted and a clean beginning to end lookup of your DNS will be triggered.
How to flush DNS cache
DNS cache is flushed using a different code which is dependent on the operating system you are using. In all cases, to flush the DNS cache of an operating system, you will need to access its command prompt or command line.
Windows
To flush the DNS cache on Windows 7 through 10+ systems:
- To open the command prompt click the Window button + R
- Type cmd and click Ok
- In the command prompt window, type ipconfig /flushdns then press Enter
A message confirming that the DNS cache has been flushed should appear.
Note:
If you are accessing the command prompt for the first time, you may be asked to confirm by typing Yes then pressing enter. If you are asked for login credentials enter them then right-click on your mouse. If you don’t have the credentials, contact your system administrator.
Mac OS
The code to flush the DNS cache of a Mac OS will differ depending on the version of the operating system.
To flush the cache of a Mac OS:
- Click on Finder > Applications > Utilities > Terminal or
- Search for Terminal in the Launchpad
- Type in the code according to your version:
MacOS Version
Command
12 Monterey sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder 11 Big Sur sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder 10.15 Catalina sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder 10.14 Mojave sudo killall -HUP mDNSResponder 10.13 High Sierra sudo killall -HUP mDNSResponder 10.12 Sierra sudo killall -HUP mDNSResponder 10.11 El Capitan sudo killall -HUP mDNSResponder 10.10 Yosemite sudo discoveryutil udnsflushcaches 10.9 Mavericks sudo killall -HUP mDNSResponder 10.8 Mountain Lion sudo killall -HUP mDNSResponder 10.7 Lion sudo killall -HUP mDNSResponder 10.6 Snow Leopard sudo dscacheutil -flushcache 10.5 Leopard sudo lookupd -flushcache 10.4 Tiger lookupd -flushcache - After entering the code, you’ll be prompted to enter your computer password if you have one and click enter
Please be aware that while typing the password into your terminal, the password will not be visible to you but it is there.
Note:
If you don’t have a password, please contact your system administrator.
Chrome
Note:
If you are using Chrome as your default browser, you will need to flush the DNS cache of Chrome along with your operating system DNS.
To flush the DNS cache of Chrome:
- Copy and paste the following URL into your browser: chrome://net-internals/#dns
- Click Clear host cache