Clearing Your DNS Cache (OSes)

Table of Contents

Windows #

To clear your DNS cache on Windows, open up the command prompt and type “ipconfig /flushdns”

Linux #

There’s no DNS caching service on Linux (Ubuntu, Fedora, CentOS, etc) distributions by default. If you use a fork that comes with some sort of caching daemon installed, you’ll need to clear that manually.

For example, Systemd Resolved (commonly found on Ubuntu distributions)

  • Open up the terminal (Ctrl+Alt+T)
  • Enter “sudo systemd-resolve –flush-caches” – if it throws an error, you probably don’t have it installed. Otherwise, it’ll return nothing

If you use Nscd (RHEL + CentOS commonly)

  • Open up the terminal (Ctrl+Alt+T)
  • Enter “sudo service nscd restart” to restart the Nscd process. If you get nscd.service not found, you probably don’t have it installed.

Mac OS #

Open up the terminal (Finder -> ApplicationsĀ -> Utilities -> Terminal).

Enter “sudo killall -HUP mDNSResponder” – you’ll be prompted to enter your password.

If you’re on an older version of MacOS you’ll need to follow some different steps.

MacOS 10.11 and 10.9

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

10.10

sudo discoveryutil mdnsflushcache
sudo discoveryutil udnsflushcaches

10.6 and 10.5

sudo dscacheutil -flushcache

You may also need to clear your browser’s DNS cache after this.