3. Run one of the following commands depending on the MacOS version you're using and press Enter, then type your user password when prompted:
OS version | Command to clear cache |
OS X Yosemite OS X El Capitan MacOS Sierra and High Sierra MacOS Mojave | sudo killall -HUP mDNSResponder
or sudo killall -HUP mDNSResponder; say DNS cache flushed |
MacOS Catalina | sudo killall -HUP mDNSResponder; |
MacOS Big Sur MacOS Monterey MacOS Sonoma MacOS Sequoia MacOS Tahoe | sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder |
Windows OSBelow you can find instructions on how to clear local DNS cache on different versions of Windows OS.
1. Click on the
Start button

.
2. Click
All Programs >
Accessories > right-click on
Command Prompt and choose Run as Administrator:

3. In the Command Prompt window type in
ipconfig /flushdns and press
Enter:

4. Once done, you will see the following message: Successfully flushed the DNS Resolver Cache.
The Flush DNS command on Windows 8/10 is the same as on Windows 7 and Vista, the difference is only in how to open the command prompt.
1. Press the
Start button

>
Applications > type
Command prompt in the search bar:

2. In the Command Prompt window type in
ipconfig /flushdns and press
Enter:

3. After the cache is cleared, you will get the following message: Successfully flushed the DNS Resolver Cache.
1. Press the
Start button >
Applications > type
Command Prompt in the search bar:

2. In the Command Prompt window, type in
ipconfig /flushdns and press Enter:

3.After the cache is cleared, you will get the following message:
Successfully flushed the DNS Resolver Cache.
Linux OSDifferent Linux distributions use different DNS resolvers (e.g.,
systemd-resolved, nscd, dnsmasq,
or
NetworkManager
).
To check which DNS service your system uses, run the following command in your favorite terminal/shell application:
ps aux | grep -E "systemd-resolved|nscd|dnsmasq"
You will see the name of the DNS resolver used on your Linux system in the output of this command. It may be
systemd-resolved
,
nscd
, or
dnsmasq
.
If none of those appear, your system might rely on
NetworkManager
or your browser’s DNS cache.
After you know which DNS resolver is used in your system, choose the correct command for clearing a local DNS cache for this resolver:
Resolver | Command to clear cache |
systemd-resolved | sudo systemd-resolve --flush-caches |
resolvectl | sudo resolvectl flush-caches |
nscd | sudo systemctl restart nscd
|
dnsmasq
| sudo systemctl restart dnsmasq
|
NetworkManager
| NetworkManager
sudo systemctl restart NetworkManager
|
You can check if the cache was flushed successfully using this command:
$ sudo systemd-resolve --statistics
If you see a
zero by the
Current Cache Size, you have successfully flushed your system's cache.