On most UNIX/Linux systems I’ve used changes to /etc/hosts are real time. In OS X you most reload the hosts file. This can be done with a single command rather than rebooting your machine.
sudo niload -v -m hosts . < /etc/hosts
Tags: BSD, Command Line, Mac, OS X, UNIX