The hosts file is a great tool to do your own DNS and to block particular domain names. However it has its weaknesses: 1. it doesn't support any sort of wildcards (so you can't add a single record for all the subdomains of a particular domain) and it chokes the Windows DNS client (dnscache) service if it's big (as big as some megabytes).

Is there an application I can run on the localhost which would act as a DNS server, parse a big hosts file (with wildcards if possible, but not necessarily) and resolve other host names with a real DNS server?

Serious DNS server software usually is fairly complex to set up and seems an overkill when all I need is the above.

  • unbound (+stubby optionnally) is a good and simple choice for Windows or other OS: the default configuration make it work out of the box. However I don't think/i'm not sure it will read an hosts file or handle wildcards the way you think about it. You may instead want the bind RPZ feature, but that will not be for Windows I guess. – Patrick Mevzek Sep 6 '19 at 2:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.