HOSTS File: Change an External Domain to Point Somewhere Else

If you update your hosts file to point a domain to another location, accessing that domain will take you to your new destination. For example, in Windows, your hosts file is at

C:WindowsSystem32driversetchosts

If you add the following:

127.0.0.1 www.google.com

and then open your browser and go to www.google.com, you will not see Google’s home page but rather your local host index page.  This can be handy when you want to disable one javascript include in a page that you don’t have access to. By pointing the external javascript domain to your local host, a 404 not found will be triggered which will prevent the code from running. Everything else, including other references to external javascript files,  in the page will still continue to execute.