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 /displaydns shows what Windows has cached

Network and access
~/tips/tip-dns-windows-displaydns

ipconfig /displaydns

Lists the names Windows has cached, including entries from the hosts file.

Windows keeps its own DNS cache, and you can read it.

From a command prompt:

ipconfig /displaydns
ipconfig /flushdns

Microsoft’s docs say the first one shows the contents of the resolver cache, including entries preloaded from the local hosts file and recently obtained records. So it doubles as a check on whether your hosts file edit was picked up.

/flushdns clears the cache. The docs mention that it also discards negative entries, meaning cached failures. That is the reason to run it after you fixed a record that was missing a minute ago: Windows may remember the failure.

The list can get long, so pipe it into findstr to look for one name. And as always, a flush only clears this machine. A router or an ISP resolver can still hand you the old answer until its TTL runs out.

On Windows, PowerShell has Get-DnsClientCache, which shows the same cache as objects you can filter. I stay with ipconfig because it is short and it works the same on every Windows machine I meet, including the old ones.

Further reading: ipconfig reference (Microsoft Learn), On this site: getent hosts shows what your programs really resolve, On this site: DISABLE_RESOLVER makes Nginx Proxy Manager use your own DNS settings

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