WARNING: Please read before continuing ▼
Difficulty: Expert
Time: ~1 Minute
Last Updated: 1st November 2009
Applies to: Windows, OS X, and Linux
Sometimes, when messing around with domain names (the DNS system), you’ll mis-type an address, and be unable to access your site for a significant length of time. Assuming that the incorrect entry has not been cached on another DNS server somewhere between you and your host, you can clear the list of cached addresses on your own machine to resolve the problem.
Windows:
On Windows XP/Vista/2003/2008/7, clearing the local DNS cache is a single command.
Open up an elevated command prompt, and type
1 | ipconfig /flushdns |
This will clear the local cache, however, your router, modem, and any applications on your computer may have their own caches.
OS X 10.4:
To clear the DNS cache on OS X 10.4 (Tiger), open Terminal.app and enter:
1 | lookupd -flushcache |
This will clear the local cache, however, your router, modem, and any applications on your computer may have their own caches.
OS X 10.5+:
To clear the DNS cache on OS X 10.5+ (Leopard and Snow Leopard), open Terminal.app and enter:
1 | dscacheutil -flushcache |
This will clear the local cache, however, your router, modem, and any applications on your computer may have their own caches.
Linux:
To clear the DNS cache on most versions of Linux (tested with Ubuntu 9.10, OpenSuse 11.1, and Gentoo) you need to restart the name service caching daemon (nscd):
1 | /etc/init.d/nscd restart |
If this command does not work, your distribution may have located init.d/ in a non-standard location, possibly /etc/rc.d/. Consult your distributions documentation to find out where the init.d/ is located.
This will clear the local cache, however, your router, modem, and any applications on your computer may have their own caches.