When should I clear the Windows DNS cache for a server?
Clear the local DNS cache when your Windows computer may be reusing an outdated cached answer after a confirmed DNS change. This does not update authoritative records, clear every application cache or force other resolvers to refresh immediately.
Instructions
1. Confirm the expected DNS answer first
Check the published record through your approved DNS tools and confirm the server address. Clearing a cache will not fix a wrong authoritative record.
2. Clear the local client cache
Use one of these equivalent methods in the appropriate local shell. Administrative rights may be required by your Windows environment.
Clear-DnsClientCacheThis removes cached entries from the local Windows DNS client.
ipconfig /flushdnsThis is the CMD alternative. It affects your Windows computer, not the remote server.
3. Resolve and reconnect again
Query the actual name and retest the service using normal TLS or SSH identity checks.
Resolve-DnsName -Name vps.example.com -Type A -DnsOnlyCompare the returned address with the current authoritative record and service details.
Check the result
- The local cache clear completes without an error.
- The subsequent DNS answer and service endpoint match the intended current server.
Troubleshooting
- The old address still appears
- The upstream resolver may still cache it, the authoritative record may be wrong, or the application may use another resolver.
- Only one application remains affected
- Check that application’s DNS behaviour or restart its connection normally; do not repeatedly change global network settings.
Official references
Use the documentation for your installed version when a flag, service name or platform feature differs.
