How to Flush the DNS Cache (Windows, macOS, Linux)

Updated: 2026-05-30

Your computer caches DNS answers for speed. After a site changes its IP, the old cached record can cause errors until it expires. Flushing forces fresh lookups.

Windows

ipconfig /flushdns

PowerShell alternative:

Clear-DnsClientCache

macOS

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Linux

Depends on the resolver in use:

# systemd-resolved
sudo resolvectl flush-caches
# nscd
sudo systemctl restart nscd
# dnsmasq
sudo systemctl restart dnsmasq

Verify

After flushing, confirm the new record with the DNS Lookup tool or nslookup / dig (see Windows commands and dig/nslookup).

Browsers keep their own DNS cache too. In Chrome, clear it at chrome://net-internals/#dns.

Sources