Quick Tip: Clear DNS Cache in Mac OS X
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
in Mac OS X Leopard and later, use this instead:
dscacheutil -flushcache

I don’t think I’ve come across an instance where I would need this, but good to know
[...] Rychlý tip: čištění dns cache lookupd -flushcache zdroj: os x daily [...]
unfortunately no longer in leopard…. :-/
dscacheutil replaces lookupd in leopard. So it just becomes dscacheutil -flushcachel
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”.
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.
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
[...] vyčistit DNS cache, můžete tak učinit pomocí následujícího příkazu (dle vašeho OS): Tiger: lookupd -flushcache Leopard: dscacheutil [...]
i run dscacheutil -flushcache.. it gives me a “command not found” error
i also tried lookupd -flushcache, “command not found”
i did th whese while running in DVD OS X Leopard.
Also have this problem. . and also no idea how to fix it. .
The IP got changed on a site I was working with and I tried the command dscacheutil -flushcache it seemed to work but the DNS did not flush. I still cant view the site.