HostAdvice Special Deals! Save 75% on all Shared Hosting Plans & Locations

Happy Birthday WordPress! Save 75% on all Shared Hosting Plans & Locations - Starting from $2.49/mo

How to clear your local DNS cache

Updated on Apr 23, 2018

The DNS cache stores the IP addresses of the websites that you have recently accessed via your web browser. That accelerates access by skipping the process of querying the name servers.

Navigation List

step

When should you clear your DNS Cache

  • If a website that you have accessed, changes its IP address, you will not be able to access it since the web browser would still be looking at the old address of the server, which is stored in the DNS cache.
  • If you are pointing your domain from one server to another (e.g., you are transferring your website from one host to another), this will change your website's IP. In order to immediately be able to access your website and skip the propagation of the ISP's DNS cache (same as your cache, with the only difference that it is for your internet provider) you would have to clear your cache and also edit the hosts file to explicitly point your domain to the new server's IP.
step

How to clear DNS cache in Windows

Windows 10

To clear the DNS cache in Windows 10 follow these steps:

  • Use the Search function to look for cmd.
  • Right click on Command Prompt and Run as Administrator.
  • Execute the following command:
ipconfig /flushdns

If the command is executed properly it will provide you with a successfully flushed message.

Windows 8

To clear the DNS cache in Windows 8 follow these steps:

  • Enter WinX menu (Shortcut: Win+X)
  • Right click on Command Prompt and Run as Administrator.
  • Execute the following command:
ipconfig /flushdns

If the command is executed properly it will provide you with a successfully flushed message.

Windows 7

To clear DNS cache for windows 7 follow these steps:

  • From the start menu search for cmd.
  • In the search results right click on Command Prompt and Run as Administrator.
  • Execute the following command:
ipconfig /flushdns

If the command is executed properly it will provide you with a successfully flushed message.

Windows Vista/XP/2000

To clear DNS cache for windows Vista/XP/2000, follow these steps:

  • In the Start menu click on Run….(For Vista, if you don't see the Run…. Command, search for it in the search bar.)
  • Execute the following command:
ipconfig /flushdns

If the command is executed properly it will provide you with a successfully flushed message.

step

How to Clear DNS Cache in MacOS

Administrators Access

In order to execute the commands in the steps bellow you must know the administrator's login details

MacOS 10.13 - "High Sierra" and 10.14 - "Mojave"

To clear the DNS cache for MacOS 10.13 & 10.14, you must:

  • Navigate to Applications → Utilities → Terminal
  • Execute the following command:
sudo killall -HUP mDNSResponder; sleep 2

MacOS 10.12 - "Sierra"

To clear the DNS cache for MacOS 10.12, you must:

  • Navigate to Applications → Utilities → Terminal.
  • Execute the following command:
sudo killall -HUP mDNSResponder

MacOS 10.11 - "El Capitan"

To clear the DNS cache for MacOS 10.11, you must:

  • Navigate to Applications → Utilities → Terminal.
  • Execute the following command:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

MacOS 10.10 - "Yosemite"

To clear the DNS cache for MacOS 10.10, you must:

  • Navigate to Applications → Utilities → Terminal.
  • Execute the following command:
sudo discoveryutil mdnsflushcache

MacOS 10.7,10.8, 10.9

To clear the DNS cache for MacOS 10.7, 10.8 & 10.9, you must:

  • Navigate to Applications → Utilities → Terminal
  • Execute the following command:
sudo killall -HUP mDNSResponder

MacOS 10.5, 10.6

To clear the DNS cache for MacOS 10.5, 10.6, you must:

  • Navigate to Applications → Utilities → Terminal
  • Execute the following command:
sudo dscacheutil -flushcache
step

How to Clear DNS Cache in Linux

Ubuntu (Linux Debian)

To clear the DNS cache in Ubuntu, you will have to:

  • Press Ctrl+Alt+T to open the Terminal.
  • Execute the following command:
sudo /etc/init.d/nscd restart


Now you know why and how to flush your DNS cache on any of the widely used Operating Systems.

On this page...

    SSD Web Hosting

    • Free Domain Transfer
    • 24/7 Technical Support
    • Fast SSD Storage
    • Hack-free Protection
    • Free Script Installation
    • Free Website Transfer
    • Free Cloudflare CDN
    • Immediate Activation
    View More