HostsMan will block a bunch of adware, spyware, porn, and trojans from your system using this exact method.
http://www.abelhadigital.com/
Version 3.1.57 can even be set to auto-update.
BFL