How to clear DNS cache?

When migrating a website to a new hosting server, it is necessary to change the DNS servers of the domain. For a certain period of time, we can not always get to our website correctly. This is due to the fact that DNS propagation is taking place. Flushing local dns cache may help here - but it's not always the case.

How to clear local DNS cache on Windows?

1. Press Windows+R keys together to open Windows command prompt console, end type cmd and hit enter.

2. In new window type ipconfig /flushdns and hit enter.

How to clear local DNS cache on MacOS?

1. Press CMD+spacebar or press F4 button, and then type terminal and hit enter.

2. Depending on MacOS version, you will need to execute one of bellows command:

  • MacOS Sierra, X El Capitan, X Mavericks, X Mountain Lion, or X Lion: sudo killall -HUP mDNSResponder
  • MacOS X Yosemite: sudo discoveryutil udnsflushcaches
  • MacOS X Snow Leopard: sudo dscacheutil -flushcache
  • MacOS X Leopard: sudo lookupd -flushcache

How to clear local DNS cache on Linux?

By default, Linux doesn’t cache DNS records. But If you have installed Name Service Caching Daemon (NSCD), then steps below will show you how to flush local DNS cache:

1. Open terminal window or console

2. Type one of this command depending on distribution you are using:

  • sudo /etc/init.d/nscd restart
  • sudo service nscd restart
  • sudo service nscd reload
  • sudo systemctl restart nscd

dns, windows, dns cache, macos, linux, terminal, konsola, console, nscd

Also Read