1

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.

  • Create a DNS proxy like this bloke? https://codemyroad.wordpress.com/2013/08/31/monitoring-home-web-traffic-with-a-local-dns-proxy/ – Alex K. Sep 09 '17 at 15:26
  • @AlexK.: A DNS proxy could accomplish the stated goals; I'll have to provide further clarification above. When out and about with a laptop, I'd prefer not to be tweaking local DNS server settings when, say, I connect to a wifi capture portal system. From a more "idealist" perspective, I feel this (greater control over and visibility into DNS requests) is something that would ideally be done at the operating system level, rather than the network. – user2057674 Sep 09 '17 at 15:53

0 Answers0