Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.