Step 1 – Open the
Either by start typing Terminal on the Spotlight, or by going into Applications -> Utilities -> Terminal.

Step 2 – Open the hosts file
Open the hosts by typing on the Terminal that you have just opened:

$ sudo nano /private/etc/hosts

Type your user password when prompted.

Step 3 – Flush the DNS cache
On Leopard you can issue a simple Terminal command to flush the DNS cache, and have your host file changes to take immediate effect:

$ dscacheutil -flushcache


Sumber :