none
Clear-Dns​Server​Cache CacheScope ? RRS feed

  • Question

  • Hi! For a specific task, we need to clear only the cache for a specific zone (not the whole cache...)

    I can use Clear-DnsServerCache with the -CacheScope parameter but any idea on how to use it ? Let's say I would like to only clear the "ac" cache entries

    Clear-DnsServerCache-ComputerName"DNS-Server"-CacheScope "ac" or

    Clear-DnsServerCache-ComputerName"DNS-Server"-CacheScope "DC=ac"

    don't work...any idea on how to use the CacheScopre parameter ? The documentation only mentions it's a string...

    https://docs.microsoft.com/en-us/powershell/module/dnsserver/clear-dnsservercache?view=win10-ps

    Thanks!


    • Edited by Pierre-Luc R Wednesday, April 17, 2019 1:16 PM image didn't work..
    Wednesday, April 17, 2019 1:15 PM

All replies

  • Hi,

    What is error message? could you show me a screenshot?

    I tested the command on my DNS server and it failed too.

    If I don't add the CacheScope parameter, it works.

    Best regards,

    Travis


    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Thursday, April 18, 2019 6:32 AM
    Moderator
  • Hi! Here is the screenshot :

    You will notice I used Show-DnsServerCache but it's the same result as Clear-DnsServerCache...I just wanted to test with "show" to make sure I had the right CacheScope before risking of clearing it all.

    I also tried with -CacheScope "dc=ac" with same result. The message is in French though which could be translated by something like "Fail to get the informations for the ac scope of the zone ..cache on the XXX server"

    Thanks :)

    Thursday, April 18, 2019 12:56 PM
  • Hi,

    Thanks for your reply.

    Yes, I noticed that these commands with the CacheScope parameter don't work.

    I don't think the problem is related to scope names.

    However, I am not a master of powershell and I would suggest you aske in Powershell Forum for better answers.

    https://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverpowershell  

    Best regards,

    Travis


    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Friday, April 19, 2019 6:22 AM
    Moderator
  • Hi,

    Just checking in to see if the information provided was helpful.

    Please let us know if you would like further assistance.

    Best Regards,

    Travis


    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Tuesday, April 23, 2019 7:10 AM
    Moderator
  • I'll check in the PowerShell forum if they can help me!

    You can close this thread in here!

    Thanks

    Tuesday, April 23, 2019 12:48 PM
  • Hi,

    Wish you could get a more satisfying explanation and solution to this issue.

    If you find anything helpful please also share with us. It may help other forum members who have similar questions.

    Best regards,

    Travis


    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, April 24, 2019 3:31 AM
    Moderator
  • Yes, basically it was because we can't delete "single" entries. Since the entry I wanted to delete was part of the Default cache zone, I can only delete the whole default cache.

    Here is a link to the other post I made in the PowerShell forums:

    https://social.technet.microsoft.com/Forums/windowsserver/en-US/cf888da3-b3f8-4fb3-8db3-8c48ce3486a8/cleardns8203server8203cache-cachescope-parameter-syntax?forum=winserverpowershell

    Wednesday, April 24, 2019 12:15 PM
  • Hi,

    Thanks for your posting here and sharing the resolution in the forum as it would be helpful to anyone who encounters similar issues.

    If there is anything else we can do for you, please feel free to post in the forum.

    Best regards,

    Travis


    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Thursday, April 25, 2019 6:03 AM
    Moderator