Most operating systems and DNS clients will automatically cache IP Addresses and other DNS results to speed up subsequent requests to the same hostname. Sometimes bad results will be cached and therefore need to be cleared from the cache in order for you to communicate with the host correctly (i.e. when you're trying to go to the domain, it's actually pulling up an old IP address that's cached on your own computer instead of looking for a new one and finding the correct record). All major operating systems allow you to force this process, outlined below are the common steps you will need to follow in order to flush your DNS cache.
Perform the following tasks, according to your Operating System, to flush DNS for your computer.
Windows
To flush DNS cache in Microsoft Windows (Win 7/Vista, Win XP, Win ME, Win 2000):
-
Go to the Start menu, click Run and type 'cmd'
-
In the command prompt type 'ipconfig /flushdns'
Done! You Window DNS cache has just been flushed.
Linux
To flush the DNS cache in Linux:
-
Type '/etc/rc.d/init.d/nscd restart' in your terminal window
-
Run that command
Done! Your Linux DNS cache has just been flushed.
Mac OSX
To flush the DNS cache in Mac OSX:
-
Type 'dscacheutil –flushcache' in your Terminal window and press the Enter key
Example: user$ dscacheutil -flushcache
Done! Your OS X DNS cache has been flushed.
Mac OSX Leopard
To flush the DNS cache in Mac OS X Leopard:
-
Type 'dscacheutil -flushcache' in your Terminal window
Example: bash-2.05a$ dscacheutil -flushcache
Done! Your OS X Leopard DNS cache has been flushed.
Mac OSX Yosemite
(Please Note: If you are using Yosemite 10.10.4 or 10.10.5, these instructions won't work. Please use the instructions for flushing your DNS on either Mac OSX or Mac OSX Leopard.)To flush the DNS cache in Mac OS X Leopard you need to use the Terminal to reset cache. You can find the Terminal app by searching for it from Spotlight. To completely clear all DNS caches, target both MDNS (Multicast DNS) and UDNS (Unicast DNS) with two different commands.
Clear MDNS Cache:
-
Type 'sudo discoveryutil mdnsflushcache' in your terminal window
-
Press the Return key
-
Enter the admin password when requested
Clear UDNS Cache:
-
Type 'sudo discoveryutil udnsflushcaches' in your terminal window
-
Press the Return key
-
Enter the admin password when requested
Done! Your OS X Yosemite DNS cache has been flushed.