Skip to main content

Flush the DNS cache on Windows, macOS and Linux

When to use this​

A DNS record was recently changed but your computer still resolves the old address.

Windows​

ipconfig /flushdns

To view the cache first:

Get-DnsClientCache

macOS​

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

Linux (systemd-resolved)​

resolvectl flush-caches

Other distributions may use nscd or dnsmasq; restart that service instead.

Verify​

nslookup example.com
tip

Browsers keep their own DNS cache too. Restart the browser, or clear its host cache, if the old address persists.