How to Edit the Hosts File in Mac OS X with Terminal

1. sudo nano /private/etc/hosts
1.1. put your changes
1.2. CTRL+O (press ENTER in order to save)
1.3. CTRL+X (to exit nano)

2. sudo killall -HUP mDNSResponder

3. dscacheutil -flushcache

You may also like...