Clear DnsClientCache - PowerShell


Clear-DnsClientCache removes the local computer’s DNS client cache, improving network connectivity and resolving issues related to outdated or incorrect DNS entries.


Clear-DnsClientCache [-Name <String>] [-Confirm] [-WhatIf] [-Force] [<CommonParameters>]


  • -Name: (Optional) Specifies the name of the DNS client whose cache should be cleared. Defaults to the current client.
  • -Confirm: (Optional) Prompts the user for confirmation before executing the command.
  • -WhatIf: (Optional) Simulates the command’s execution without making any actual changes.
  • -Force: (Optional) Suppresses confirmation prompts and forces the command to execute.


Clear the local DNS client cache:


Clear the cache for a specific DNS client named “myClient”:

Clear-DnsClientCache -Name myClient

Common Issues

  • Failed to clear DNS cache: Ensure you have sufficient permissions to perform the operation or that the specified DNS client exists.


  • Combine with Invoke-WebRequest to test network connectivity after clearing the DNS cache.
  • Use with Get-DnsClientCacheEntry to check the contents of the DNS cache before and after clearing.
  • Resolve-DnsName: Resolves DNS names to IP addresses.
  • **Get-DnsClient`: Gets information about DNS clients.