Monday, July 16, 2012

Windows XP HOSTS File

To avoid web tracking and web ads, it is often useful to blacklist domains in the HOSTS file.  On Windows XP, the HOSTS file is drive:\WINDOWS\system32\drivers\etc.


















Make a backup before editing the file.  To avoid breaking the earlier entries, add new entries to the bottom of the file. 
An entry to black hole a domain will look like the following. 
127.0.0.1       cdn.optmd.com

This shows before and after for a host lookup of cdn.optmd.com.  In the second ping, it resolves to the localhost.