Acrylic DNS Proxy (free, open source) does the job. It creates a proxy DNS server (on your own computer) with its own hosts file. The hosts file accepts wildcards.Download from the offical website
Source: apache – Wildcards in a Windows hosts file – Stack Overflow
Awesome! Nice, open-source, caching DNS proxy for Windows. Gives you a hosts file that is extremely flexible. Can finally say something like “127.0.0.1 >facebook.com” for blocking all of Facebook’s irritatingly ubiquitous JavaScript.