1

I want to do a real time monitor of the DNS cache requests of the system in c#. My system is a windows 7 64 bit. What I did so far is to catch the DNS requests by creating a listening UDP server on port 53, but this monitors ALL the DNS request, what I am interested in are only request made to DNS cache of the local OS. Is there a way to monitor the DNS cache of the system? THx

Lucian
  • 874
  • 11
  • 33
  • Maybe this post can be of help: http://stackoverflow.com/questions/7998176/retrieving-whats-in-the-dns-cache. It's about reading the cache with an API. Maybe it provides signalling. – Marvin Smit Oct 28 '14 at 10:28

1 Answers1

0

You can get your DNS cache via this powershell function: Show-DnsServerCache

And this SO post illustrates how to call powershell functions from C#.

Community
  • 1
  • 1
DMAN
  • 471
  • 2
  • 8
  • Yes, thx for the answer but it seems that it can be an option but only for Windows Server 2012 R2 and Windows 8.1. – Lucian Nov 20 '14 at 07:28