turnings

passions :: perfections :: peoples :: stuffs

Applying changes to hosts file on OS X (without restarting)

leave a comment »

Some machines seem to have no problem with changes to the hosts file, others seem to have quite a bit of trouble with caches and things hanging onto information. This has worked once or twice now, and I thought I’d bother to re-document it (for myself at very least).

To add an entry:
Edit /etc/hosts
sudo niload -v -m hosts .  Clear Private data and clear things.
lookupd -flushcache

To remove the entry:
Edit /etc/hosts
sudo niload -v -d hosts .  Clear Private data and clear things.
lookupd -flushcache
Notice the -d for deletion.

Source: Coding In Paradise

Written by Daniel

March 17, 2009 at 7:33 pm

Posted in tech

Leave a Reply