OS Xで/etc/hostsを書き換えるには

/etc/hostsを書き換えたあとに

% dscacheutil -flushcache

すればいい。