Editing the hostfile in MAC OS X is an easier task.
Go to Applications > Utilities > Terminal.
Open the hosts by typing on the terminal, here is the command.
” sudo nano /private/etc/hosts ”
Type your Username and password and then Ok.
The host contains some comments,the lines are starting with the # symbol.You can navigate the file using the arrow keys.
Sfter editing the hostfile, Press Cntrl + o to save this file.
For Exit Press Control + X.
Note : For immediate effect,Flush the DNS Cache.