Flush DNS

If you are running into a lot of “Page Not Found” errors and you’re connected to the internet, you may need to flush your DNS cache. This article will show you how to do this on Windows, Mac, and Linux computers.

10 Second Summary

  • Windows: Open Command Prompt, and use the DNS flush command. Exit Command Prompt when done. More ↓
  • Mac OS X: Open Terminal and enter the DNS flush command. Enter your password when prompted.
  • Linux: Open the terminal. Restart the service network-manager.

Steps

Using Windows

  1. Open the command prompt. The command to flush DNS needs to be entered in the command prompt. Accessing the command prompt is slightly different depending on which version of Windows you are running:
    • Windows 8 - Press the Windows key + X and select “Command Prompt (Administrator)”.
    • Windows 7/Vista - Click the Start menu and enter “cmd” into the Search field. Right click on Command Prompt and select “Run As Administrator”.
    • Windows XP - Click on the Start menu and then click Run. Enter “cmd” into the Run field and press Enter.
  2. Use the DNS flush command. Type ipconfig /flushdns and press Enter. A message will appear stating “Windows IP configuration successfully flushed the DNS Resolver Cache”.
  3. Exit the command prompt. Type exit and press Enter. This will close the command prompt.

Using Mac OS

  1. Open the Terminal. You can find the Terminal application in the Utilities folder in your Applications folder.
  2. Enter the DNS flush command. The command varies depending on which version of Mac OS X you are running.
    • 10.5 and newer - dscacheutil -flushcache to flush the DNS, and then sudo killall -HUP mDNSResponder to reload the DNS.
    • 10.4 and older - lookupd -flushcache to flush the DNS, and then sudo killall -HUP mDNSResponder to reload the DNS.
  3. Enter the password. You will most likely be asked for the administrator password before you can proceed with the DNS flush.[1]

Using Linux

  1. Open the terminal. Open the terminal as root, or enter sudo before entering the DNS flush command.
  2. Restart the service network-manager. In the terminal, enter service network-manager restart and press Enter. This will flush your DNS.


Tips

  • If you are using Microsoft Windows, you can temporarily disable DNS caching by opening "cmd" and typing "net stop dnscache" into the window after the command prompt. Then, hit the "Enter" key. This will halt DNS caching until the next time your reboot your computer.
  • You can permanently disable DNS caching in Windows by running the program called "services.msc." Type "services.msc" in either the run or the search box under the Start menu, depending on what version of Windows you are using. When the window appears, find "DNS Client" and double click on it. Click "Stop." To enable DNS caching after you have stopped it, complete the same process, but click on "Start" instead of "Stop."

Sources and Citations