Is there a way to create a wildcard domain in the Windows hosts file.
I tried this
This does not work, is there maybe some other syntax I should use?
I am working on Windows 7
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
There is not. The hosts file isn't very clever, you have to list every subdomain individually (including www and no-www)
Wildcard Support on XP at hostsfile. Enjoy.
Basically, this program Acrylic works as a DNS proxy for your local machine. Just point your Local Area Connection to 127.0.0.1, then edit the AcrylicHosts.txt in a very similar manner to the regular hosts file -- only with wildcards!
You can use regular expression in rules. There is also some advanced features like customizing cache TTL, non-standard-port DNS server, compression pointer mutation, etc. Open sourced under MIT license.
first, i agree with phoshi that its not possible to do what you want in the hosts-file of windows (neither on unix).
secondly, you have to get control over the result of a request to dns. one option is to use your own dns-resolving on your router (dnsmasq, dnscache+tinydns, bind, whatever, see quack's comment) and tweak it or to use a dns-resolver on windows which you can control as you want.
It's another syntax: xxx.xxx.xxx.xxx somedomain.com
Some examples to explain it:
You block/lead all second (third,fourth...) level urls with the top(second,third...) level url in the hosts file.
If you want to block every subdomain in somedomain.com, then consider whether omitting "*." will achieve what you want.
Editing your example:
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?