Is there a way to monitor the system's DNS cache on c#?

╄→гoц情女王★ 提交于 2019-12-12 02:00:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!