How to Clear Local DNS Cache
Sometimes when we are surfing the internet, we would get the error message that "the web page can't be opened, please try to flush DNS Cache".
How to clear your local DNS cache instantly? Here I am glad to share with my experience to clear DNS cache on Windows 8/7/Vista/XP/Linux/Mac OS X with Command.
- Guide Steps
- Part 1: Clear local DNS cache on Windows 8/7/Vista/XP with Command Prompt
- Part 2: Commands to clear local DNS cache on Linux
- Part 3: Flush DNS cache on Mac OS X
Part 1: Clear local DNS cache on Windows 8/7/Vista/XP with Command Prompt
- Press the shortcut key (Windows + R) to open Run textbox.
- Type in: cmd, and then press Enter(or click on OK) to open Command Prompt.
Type in command: ipconfig/flushdns, and then press Enter to run the command.
- In seconds, when get the message saying "Successfully flushed the DNS Resolver Cache" that means you have clear the DNS cache.
Part 2: Commands to clear local DNS cache on Linux
If you have NSCD (Name Service Cachine Daemon) installed, you can clear the local DNS cache by running the following commands.
- To clear local DNS cache for current user, type in command: nscd –i hosts
- To clear local DNS cache for all users, type in command: nscd –I hosts
Part 3: Flush DNS cache on Mac OS X
Mac OX 10.5.1 and below
- Click on the Finder icon in your dock, and open your Applications folder.
- Open the Terminal window by clicking on Utilities, clicking on Terminal.
- Type in the command: lookup –flushcache, press Enter to run it.
Tips:
Do not be alarmed if you do not receive any kind of response from the terminal window after running the command. This is normal.
Mac OS X 10.5.2 to Mac OS X v10.6
- Click on the Finder icon in your dock, and open your Applications folder.
- Open the Terminal window by clicking on Utilities, clicking on Terminal.
- Type in the command: dscacheutil –flushcache, press Enter.
Mac OS X 10.10 Yosemite
- Open the Terminal window (refer to the steps above).
- Type the following command in the Terminal window and press Enter.
- Command: sudo discoveryutil udnsflushcaches
Mac OS X Mountain Lion or Lion
- Open the Terminal window (refer to the steps above).
- Type the following command in the Terminal window and press Enter.
- Command: killall –HUP mDNSResponder