brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: ipconfig /flushdns clears the Windows DNS cache

Network and access
~/tips/tip-windows-ipconfig-flushdns

ipconfig /flushdns

Empties the DNS cache on the Windows PC so names are looked up again.

A site moved to a new IP address, I changed a record, and Windows still goes to the old one. Before I blame the DNS server, I empty the cache on the PC.

The /flushdns option of ipconfig flushes and resets the contents of the DNS client resolver cache. Microsoft’s description adds that during DNS troubleshooting you can use it to discard negative cache entries, which are the remembered “this name does not exist” answers, as well as any other entries that were added dynamically.

ipconfig /flushdns

The matching command for looking before you flush is /displaydns, which shows the resolver cache, including entries preloaded from the hosts file and recently obtained records. Looking first tells you whether the stale answer is in the PC’s cache at all:

ipconfig /displaydns

A situation where this helps: you created a new DNS record for a service on your home network, you tried the name once before the record existed, and Windows now keeps the failed answer. After the flush, the next lookup asks the DNS server again. The same goes for a changed address after you moved a service to another machine.

The caveat is about what the command does not touch. It clears only the cache of this Windows machine. A router, a Pi-hole or any other resolver in the chain keeps its own cache, and so does a browser, so a name can stay wrong after the flush. If the answer is still old after the flush, it comes from one of those other places, and flushing the PC a second time will not change anything. Clear or wait out the cache there instead.

Further reading: ipconfig

More Network and access tips scp -3 alice@server-a:/var/backups/db.sql.gz bob@server-b:/srv/restore/ tailscale exit-node suggest tailscale lock sign nodekey:1abddef1 tlpub:abcdef12 wg genpsk > peer1.psk Table = off All Network and access tips (163) All topics

Link