I've been using this for years...
http://winhelp2002.mvps.org/hosts.htm
Download hosts.zip, extract the files, open 'hosts' folder containing extracted files, right-click on mvps.bat and select 'run as administrator', then a blue dialogue box will open. Press any key, then all of the bad connections are blocked forever. Update once in a while by re-downloading updated hosts.zip file on the site.
K, bye.
Edit - that's for a windws os.