Fresh Blurbs

Clear DNS Cache on OS-X

If you are a developer (just a geek will do, too), you have definitely put a fake DNS entry or two in your /etc/hosts file, at one time or another. Few things are more frustrating than doing that and having to restart your computer for the change to pick up. If you are running a local caching dns server (e.g. BIND) a glitch like that can happen all the time.

No worries, though. The little command below, ran from the Terminal, will clear dns cache and let your changes be applied instantaneously:

On OS-X:

  • OS-X (before Leopard): lookupd -flushcache
  • OS-X 10.5+ (Leopard and up): dscacheutil -flushcache

On other platforms:

  • Windows (NT-based versions): ipconfig /flushdns
  • Linux: /etc/rc.d/init.d/nscd restart
comments powered by Disqus