How to modify your host file

Your host file enables your system to override the DNS setting for a domain. This change only affects your system.

The syntax of a host file entry is as follows

# this is a comment

Basically you specify an IP followed by a domain. All lines beginning with # sign are comments.

Host files should only be edited with plain text editors like notepad, notepad++, sublime, etc. Following are the locations of host files on different systems:

Operating System Host file location
Mac OS /etc/hosts
Linux /etc/hosts
Microsoft Windows C:\Windows\System32\Drivers\etc\hosts