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

Refresh DNS in Yosemite

sudo discoveryutil udnsflushcaches

Book nowModern Universal React with Next.js

Stop worrying about configuration, and complex codebases: Next.js makes SSR with React easy. Book your masterclass today.

Want more?

Posts, web development learnings & insights, exclusive workshop and training discounts and more, direct to your inbox.

I won't send you any spam, and you can unsubscribe at any time. Powered by ConvertKit