I entered 0.0.0.0 softonic.com but for example this site: http://safe-n-sec.en.softonic.com/ Just loads fine, isn't there a way to block everything that ends with softonic.com as they seem to change the URL for every download
A Hosts file works with domain names only. So, if you want to block a website you need to enter its complete name. Wildcards are not allowed in a hosts file. If you need to use a wildcard then you need to install a DNS server on your PC, like dnsmasq.
No, as wildcards or placeholders are invalid in the hosts file. It blocks only and exactly what's added to it. That's the major reason why all those publicly available hosts files like MVPS are that huge as all sub-domains for, e.g., doubleclick.net and the likes have to be seperate entries. @Raza0007: dnsmasq doesn't accept wildcards, either. However, adding an entry like Code: address=/softonic.com/0.0.0.0 applies to all related sub-domains. That's why blocking of ads/trackers/malware with dnsmasq is clearly superior compared to a hosts file.
I have actually never used wildcard entries with dnsmasq personally, but before posting here I checked this Wikipedia entry and the comparison table lists the DNS servers that support wildcards and dnsmasq is listed as supporting wildcards.
Ah, okay, so I may be wrong. However, I still think that they should be unnecessary for what we're discussing here because simpy adding a domain like in the example above also covers all sub-domains. Thus, it is sufficient to add one entry like Code: address=/doubleclick.net/0.0.0.0 where you need hundreds of entries in the hosts file. And adding specific sub-domains like Code: address=/ads.example.comt/0.0.0.0 is still supported, of course.
If all your interested in doing is blocking certain domains then you could try using a PAC file. When you click on any domain that ends with in your example ( softonic.com) it will notify you that its blocked/refusing connections.
Depending on browser used you would have to configure the .pac file to use the connection settings of the browser. In Firefox and Mozilla forks - Automatic proxy configuration URL: Enter the file path into the blank field of APC (location where you put pac file) You can try a syntax like this: file:///C:/PacFIle/<name of pac file>.pac (doesn't have to be this location) Name you pac file - e.g., wipe-ads.pac or muncher.pac or any name you want to use with the .pac extension. So in this example I would type into the blank field of Automatic proxy configuration URL: file:///C:/PacFIle/wipe-ads.pac You could use an already pre-configured pac file or create your own. Also a pac file doesn't need JavaScript enabled to work. It may sound complicated but it's really not that hard to setup. http://sherylcanter.com/articles/oreilly_20040330_HostsPac.php
The most recent MVPS Hosts in plain text - it may offer some tips on formatting. http://winhelp2002.mvps.org/hosts.txt