HostArmada Web Hosting Knowledge Base

Knowledge is power! Use that power and achieve total and unconditional control over the Web Hosting Services!

How to clear the local DNS cache?

DNS cache is stored on your local PC so that each consecutive time when you access a website, your computer does not have to query the DNS servers and request its IP address. Instead, it will load this directly from the DNS cache and take you to the site much quicker than usual. You may need to clear the DNS cache when you are troubleshooting your website's connectivity issues or recently transferred your application to a new server. This article will familiarize you with how you can do this on the most commonly used operating systems. Let's dive into it.

How to flush DNS cache on Windows 7

To flush the DNS cache on Windows 7, you need to take a few relatively straightforward steps. Here is what you need to do:

  1. Open your start menu, and inside the search box, type "cmd".
  2. Right-click on the program, and from the expanded options underneath, select "Run as administrator".
  3. When you press the "Run as administrator" option, a black screen will appear that has a blinking underscore next to a line containing something simar to C:\Users\user\
  4. This black window is also known as the command prompt or command-line interface. Please type in:
ipconfig /flushdns 

     This command will display the following message:

Windows IP configuration successfully flushed the DNS resolver cache. 

And this is how you clear DNS cache on Windows 7!

How to flush DNS cache on Windows 8

To flush your local DNS cache on Windows 8, please follow the steps below:

  1. Please press the Windows + X buttons on your keyboard together in quick succession.
  2. You will see the command prompt show up as you do the above. Right-click on it, and from the expanded window, select "Run as administrator".
  3. A black screen will appear that has a blinking underscore next to a line containing something simar to C:\Users\user\
  4. This black window is also known as the command prompt or command-line interface. Please type in:
ipconfig /flushdns 

    This command will display the following message:

Windows IP configuration successfully flushed the DNS resolver cache.

And this is how you flush DNS cache on Windows 8!

How to clear DNS cache on Windows 10

To flush your local DNS cache on Windows 10, please do the following:

  1. Please press the Windows icon. You should see it on the bottom left corner of the screen.
  2. Upon doing so, you can use the keyboard and search for various things. In our case, please type in "cmd".
  3. The above search will display the command prompt. Right-click on it, and from the dropdown menu, select "Run as administrator".
  4. A black screen will appear that has a blinking underscore next to a line containing something simar to  C:\Users\user\
  5. This black window is also known as the command prompt or command-line interface. Please type in:
ipconfig /flushdns 

   and hit the "ENTER" button. Upon completion, this command will display the following message:

Windows IP configuration successfully flushed the DNS resolver cache.

And this is how you clear DNS cache on Windows 10!

How to clear DNS cache on Linux (Ubuntu and Debian-compatible distributions)

Here is what you need to flush the local DNS cache on a Linux Ubuntu and Debian-compatible distributions:

  1. Please open up the command-line interface or also known as the Terminal, by pressing the Ctrl + Alt + t button sequence on your keyboard in quick succession.
  2. When the Terminal shows up, please type in the command:
sudo /etc/init.d/networking restart 

      and press the "ENTER" button on your keyboard.

      3. You will be required to enter your sudo password and then press "ENTER" again to finalize the process.

And this is how you clear DNS cache on Linux (Ubuntu and Debian-compatible distributions).

How to clear DNS cache on Linux (CentOS)

To flush your local DNS cache on a CentOS Linux distribution, please follow these steps:

  1. Open the terminal window. Once inside, please type in and hit the "ENTER" key.
  2. Now you need to restart the DNS service. To do this, please enter the command:
service nscd restart 

    and hit the "ENTER" key again.

And this is how you flush DNS cache on Linux (CentOS)!

How to flush DNS cache on macOS systems

Each version of macOS has it's a specific command to flush its DNS cache. For you to figure out which one is yours, please follow these simple steps:

  1. Click on the "Apple" icon, which should be located on the top left corner of your screen.
  2. From the dropdown, please select the "About This Mac" option.
  3. A screen will appear, containing the name of your version in the middle.

macOS El Capitan

If you are using the El Capitan mac version, please open the terminal window and type in the command:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder 

Your computer will prompt you for the password, and when you hit the "ENTER" key, it will clear the DNS cache on mac El Capitan.

macOS Sierra

If you are using the Siera mac version, please open the terminal window and type in the command:

sudo killall -HUP mDNSResponder 

Your computer will prompt you for the password, and when you hit the "ENTER" key, it will clear the DNS cache on mac Siera.

macOS High Sierra and Mojave

If you are using either the mac High Siera or Mojave versions, please open the terminal window and type in the command:

sudo killall -HUP mDNSResponder; sleep 2 

Your computer will prompt you for the password, and when you hit the "ENTER" key, it will clear the DNS cache on mac Siera or Mojave.

macOS Catalina

If you are using the Catalina mac version, please open the terminal window and type in the command:

sudo killall -HUP mDNSResponder 

Your computer will prompt you for the password, and when you hit the "ENTER" key, it will clear the DNS cache on mac Catalina.

macOS Yosemite

If you are using the Yosemite mac version, please open the terminal window and type in the command:

sudo discoveryutil mdnsflushcache 

Your computer will prompt you for the password, and when you hit the "ENTER" key, it will clear the DNS cache on macOS Yosemite.

macOS Leopard and Snow Leopard

If you are using either macOS Leopard or Snow Leopard version, please open the terminal window and type in the command:

sudo dscacheutil -flushcache 

Your computer will prompt you for the password, and when you hit the "ENTER" key, it will clear the DNS cache on mac Leopard or Snow Leopard.

macOS Lion, Mountain Lion, and Mavericks

If you are using either macOS Lion, Mountain Lion, or Mavericks versions, please open the terminal window and type in the command:

sudo killall -HUP mDNSResponder 

Your computer will prompt you for the password, and when you hit the "ENTER" key, it will clear the DNS cache on mac Lion, Mountain Lion, and Mavericks.

Was this article useful and on point?

Find out more about HostArmada entire range of optimized Web Hosting Services and take action today on improving your website Loading Speed, Security, and overall Stability!