OS X清空DNS缓存的方法

OS X 会对DNS记录和hosts进行缓存,所以在修改/etc/hosts后不能马上看到效果。解决的办法是先su到root,然后kill了lookupd

Last login: Thu May 18 17:27:28 on ttyp2
Welcome to Darwin!
wuhongshengdeibook-g4:~ wuhongsheng$ su
Password:
wuhongshengdeibook-g4:/Users/wuhongsheng root# ps aux|grep lookupd
root     14337   0.0  0.2    29188   1292  ??  Ss    6:43下午   0:00.38 /usr/sbin/lookupd
root     14349   0.0  0.0    27884      4  p1  R+    6:51下午   0:00.00 grep lookupd
wuhongshengdeibook-g4:/Users/wuhongsheng root# kill 14337
wuhongshengdeibook-g4:/Users/wuhongsheng root#