Check out my latest project: Code Dumper

Restart lookupd (to refresh dns cache)

ps ax | grep lookupd | grep -v grep | perl -ne 'split; print $_[0]' | xargs sudo kill -HUP

I'm often connecting to different networks depending on what job I'm doing, and sometimes I'll need to tweak my /etc/hosts file. Since my system will cache DNS lookups, I'll need to restart lookupd, and this command does it in one hit.

Refresh DNS in Leopard

sudo dscacheutil -flushcache

3 Responses to “Restart lookupd (to refresh dns cache)”

  1. You could also say sudo lookupd -flushcache. I dunno how reliable that is though.

  2. Sod - this no long applies in Leopard...now to go hunting in ps auxww :-(

  3. sudo dscacheutil -flushcache

    This does the job apparently.

Leave a Reply
Not required

CODE: Please escape code and wrap in <pre><code>, doing so will automatically syntax highlight