Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a simple way I can have a powershell / cmd prompt open and stream the dns cache so that it will scroll automatically as things are being cached?

share|improve this question

Take a look at the MicrosoftDNS_Cache WMI Class in the root\MicrosoftDNS namespace. My desktop doesn't have that namespace available, but supposedly it's available for servers.

Get-WmiObject -Namespace "root\MicrosoftDNS" -Class MicrosoftDNS_Cache `
    -ComputerName $RemoteServer

That might give you a start in the direction you're looking for.

If that has the data you're looking for, you could wrap that into an endless loop like so:

while ( -1 ) {
    Get-WmiObject -Namespace "root\MicrosoftDNS" -Class MicrosoftDNS_Cache `
        -ComputerName $RemoteServer
}

Obviously you'll have to tweak the get-wmiobject code to get the output to look how you want, and as mentioned above, that's assuming the class/namespace contain the date you're looking for.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .