Open a terminal window and type this line:
sudo open -a TextEdit /etc/hosts
You will be prompt to type in your admin password and your host file will open in TextEdit. Add this line in your host file :
127.0.0.1 localhost
Save the file and close. That's it.