Flush DNS - How and why to clear your DNS cache

If you are having trouble accessing a web page or using an online service, it may be that your device has cached an out-of-date DNS record which needs to be manually cleared or reset. This is a process known as flushing your DNS cache and is easy to do, but the steps you need to take will depend on what device you are using.

How to flush your DNS cache

If you are familiar with using your systems command line or terminal, then the commands to flush your DNS for the most popular operating systems are listed below.

If you're unsure of how to use these commands, more detailed instructions including screenshots of each step can be found in the dedicated section for each version.

 
 
 

Microsoft Windows

The following command will work on Windows 7, 8, 10 + Windows Server, but opening the command prompt is slightly different for each version.

  1. Right click on the start menu and choose Command Prompt (Admin) from the menu.
  2. Type in the command ipconfig /flushdns.

 

 

 

Apple MacOS and Mac OS X

From the Mac Terminal app, you need to run the following command depending on your version:

MacOS 11 & 12 (Big Sur, Monterey)

MacOS 10.12 - 10.15 (Sierra, High Sierra, Mojave, Catalina)

Mac OS X 10.7 - 10.9 & 10.11 (Lion, Mountain Lion, Mavericks, El Capitan)

  1. Open Finder and navigate to the Applications > Utilities directory and open the Terminal app.
  2. Type in the command sudo killall -HUP mDNSResponder.
  3. Enter your password when prompted.

Mac OS X 10.10 (Yosemite)

sudo discoveryutil mdnsflushcache

Mac OS X 10.6 (Snow Leopard)

sudo dscacheutil -flushcache

Mac OS X 10.5 (Leopard) and below

sudo lookupd -flushcache

 

 

Linux

From the terminal or SSH session run the following:

systemd - Ubuntu & Debian

systemd-resolve --flush-caches

NSCD

sudo /etc/init.d/nscd restart
  • 0 Користувачі, які знайшли це корисним
Ця відповідь Вам допомогла?