Quick Tip: Clear DNS Cache in Mac OS X
March 24th, 2007 - Command Line, Mac OS X, Tips & Tricks
Anytime you visit a website or do any other kind of DNS lookup, the IP address conveniently gets cached. Well what’s convenient for most of us can be a real nuisance for others, particularly administrators who are moving around servers. Here’s a quick tip that Systems Administrators (and others) will surely appreciate. To clear the DNS cache in Mac OS X, at the Terminal type the following:
lookupd -flushcache
Mac Deals from the Apple Store:
Comments:
Comments: 8
Comment from hmills
Time: March 24, 2007, 10:22 am
I don’t think I’ve come across an instance where I would need this, but good to know
Pingback from Mac Info » Blog Archive » Střípky zajímavostí
Time: March 28, 2007, 3:01 am
[...] Rychlý tip: čištění dns cache lookupd -flushcache zdroj: os x daily [...]
Comment from Dave
Time: October 16, 2007, 2:27 pm
unfortunately no longer in leopard…. :-/
Comment from adh
Time: October 26, 2007, 7:58 pm
dscacheutil replaces lookupd in leopard. So it just becomes dscacheutil -flushcachel
Comment from David
Time: November 8, 2007, 8:05 am
Example situation where it might make sense :
Your office server has a domain name (mycompany.com), but the company’s ISP decides to change the IP address associated with your office’s internet connection. For a short while (may be as short as 2 hours, but as long as 2 or more days), all DNS requests for mycompany.com will still resolve to the old IP address (because of caches), thus making the new address totally unreachable by DNS name.
If you clear your local DNS caches, it might then resolve to the new address.
That is unless your ISP doesn’t cache itself the DNS results. In that case, your last resort is to modify your /etc/hosts file to manually override the IP address associated with “mycompany.com”.
Comment from Gil Bates
Time: February 12, 2008, 1:44 am
hmills, I happen to use this every day, multiple times a day.
I do web development work and I have a local web server running on my laptop. I have an automator script which swaps my hosts file to point to the “real” site or my local development site with one click. At the end of the script, I clear the DNS cache. That way I can switch back and forth.
Comment from Liviu Voicu
Time: March 30, 2008, 12:50 am
Hello every one,
I’m having an annoying problem since 3 days, I can not connect to any google domain and a few others (yahoo), using Leopard…
I ran dscacheutil -flushcachel and it didn’t help ![]()
Could anyone help me please?
Thanks
Pingback from Suspendeddomain.cn affecting Lotus Talk browsing - Page 2 - LotusTalk - The Lotus Cars Community
Time: November 25, 2008, 8:43 pm
[...] I doubt it’s a browser issue. You probably need to flush your DNS cache On Windows do this: Clear local DNS Cache (Windows 2000/XP/2003) - TACKtech Corp. On Mac do this: Quick Tip: Clear DNS Cache in Mac OS X - OS X Daily __________________ Daily driver: Arctic Silver 2005 Lotus Elise. Weekend toy: Arctic Silver 2005 Lotus Elise. Road tripper: Arctic Silver 2005 Lotus Elise. [...]
Social bookmarks:
- | del.icio.us | Digg it | Furl | Netscape | reddit | StumbleUpon | Yahoo MyWeb |
March 24th, 2007


Write a comment