Flush DNS Cache

How to clear the DNS cache on Windows, macOS, and Linux.

macOS

Run the following command in the terminal:

1
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Windows

Run the following command in the Command Prompt with administrator privileges:

1
ipconfig /flushdns

Linux

For systems using systemd, run the following command in the terminal:

1
sudo resolvectl flush-caches

Alternatively, you can restart the service:

1
sudo systemctl restart systemd-resolved

The end.