问题
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
回答1:
You can get your DNS cache via this powershell function: Show-DnsServerCache
And this SO post illustrates how to call powershell functions from C#.
来源:https://stackoverflow.com/questions/26605690/is-there-a-way-to-monitor-the-systems-dns-cache-on-c