Clear the DNS cache with Mac OS X

To clear the lookupd cache, use:

lookupd -flushcache

To run this command, open a Terminal window (in a Finder windows Applications -> Utilities -> Terminal) and just type in the command as shown above. This is a low-risk command. The data stored in lookupd’s cache are temporary by design. By default, an entry will only stay in the cache for 12 hours.

If it seems like this doesn’t work, it is possible that the application you are testing with also caches its DNS queries. For example, the Firefox browser caches DNS entries internally for 60 seconds. In this case, the easiest solution is to sit on your hands for a minute.