On Lion (Mac OS X 10.5, 10.6, or 10.7)

dscacheutil –flushcache

On Mac OS X 10.4 Tiger

lookupd –flushcache