I would like to be able to intercept DNS queries on my Windows computer by "hooking" into "all of the DNS functions" (Is it possible to intercept dns queries using LSP/SPI?).
So, for example, if I have a config file with contents:
*.example.com
I am hoping to handle these requests with a response of 127.0.0.1. Wildcarding doesn't work in the hosts file (and I also might try logging some queries, too). This can be done from a network level; I want to do it through the host operating system, partially out of a perfectionist bent.
Someone else suggested "Hooking DNSQuery() function calls in dnsapi.lib/dnsap.dll" (Windows DNS hooks).
Will the mhook library allow me to do what I want to do?
Lastly: I have no intention of making malware; I want to take a bit more control over the traffic my computer(s) are creating.