How to Flush DNS Cache in Apple Mac OSX Leopard

Many of you might not know that beside Microsoft Windows has DNS caching, Apple Mac OSX Leopard does too. In order to flush the cached DNS in your Apple Mac OSX Leopard and get the latest resolve value, you can do this in your Mac Terminal.

Flush Cached DNS

In your shell, type;


dscacheutil -flushcache

To see the caching statistic on your machine, type;


dscacheutil -statistics

This command doesn’t required sudo privilege cause it’s flush base on user’s cache statistic.

Related posts:

  1. Install MySQL5 Server on Apple Mac Leopard with MacPorts Previously I wrote a post on “installing postgresql 8.2 on...
  2. MySQL 5 Server Cannot Start on Apple Mac Leopard There were some problem during configuring MySQL5 Server on Leopard...
  3. postgresql82-server compile error on Apple Leopard with Macports 1.5 I wasn’t able to compile postgresql82-server on my machine, it’s...
  4. How do I Start Application Services with launchctl When Apple Mac Leopard Boot Up If you have MySQL, PostgreSQL, Apache2 or other application installed...
  5. How to Switch Active Windows in Apple Mac OS X Leopard If you are new to Apple Mac OS X, you...
  6. PgPool – PostgreSQL Connection Cache Playing PgPool on a heavy load database server is fun....
  7. Configure IPV6 on Apple and Windows Do you have IPV6 network ready in your office? Lets...
  8. installing postgresql 8.2 on Leopard with macports postgresql! one of my favorite high performance open source db,...
  9. How to Remove MySQL Binary Log By default, MySQL 5.0 and above enables MySQL Binary Log....
  10. How to Edit Cell in Microsoft Excel on Mac OSX Leopard Many windows user may know that F2 is the shortcut...

3 Responses to “How to Flush DNS Cache in Apple Mac OSX Leopard”

  1. Ben Margolin Says:

    This doesn’t seem to actually work (the flush) for me. It seems like it should, and the manpage seems to imply it will, but I’ve got a bad IP address in my cache due to a bad /etc/hosts entry, and it’s still stuck there, even after removing, or correcting, it in the hosts file.

  2. Ben Margolin Says:

    This doesn’t seem to actually work (the flush) for me. It seems like it should, and the manpage seems to imply it will, but I’ve got a bad IP address in my cache due to a bad /etc/hosts entry, and it’s still stuck there, even after removing, or correcting, it in the hosts file.

  3. Flush DNS Says:

    Another useful way of flushing the dns is by running “lookupd -flushcache” which should work on earlier versions of OS X.

Leave a Reply