How to flush your computers DNS cache
- Quick and thorough
When DNS changes are made they occur instantly on our nameservers. However, it may be some time before your computer (or your customer's computers) see the changes. This is because every DNS record has something called a Time To Live (TTL) value. The TTL tells other DNS servers how long to cache a DNS record for before refreshing their local data - it's important because it controls the amount of DNS traffic on the internet.
Normally DNS records are set with a TTL value of 14400 (it's in seconds - so this is 4 hours), but some DNS records have a 24 hour TTL value (86400) so it can take up to a day to see the changes take effect.
The TTL delay is compounded by the fact that your operating system (Windows and Macs) both cache DNS data to reduce the number of requests they make to your ISP. On top of that, web browsers also create a local cache. And, if you have a broadband router (or modem/router) it's likely that will be where your local devices request DNS lookup from - and that'll be caching the responses too.
You have a couple of options here - the quick and thorough way - that's most likely to ensure you pick up fresh DNS - or options to try and clear your local device's DNS cache (note this won't clear your browser cache - or your router). We have a separate article on clearing your browser cache.
Quick and thorough
Turn it off and on again! I know it's an age old cliché - but simply powering down your router/modem and shutting down your device(s) for a few minutes and then restarting them will cause them to start up with a clear DNS cache. This method often works, but can still be subject to any DNS proxy your ISP may have in place - which may cause your router to simply continue to pick up the old address until your ISP's cache entries get refreshed.
You can get around using your ISP's DNS servers by setting your device to use third party servers like those provided by Cloudflare (184.108.40.206 and 220.127.116.11) or Google (18.104.22.168 and 22.214.171.124). Most modern routers allow you set the DNS servers provided to devices on your local network - so setting these on the router means you won't have to reconfigure each device.
Access the Command Prompt by either:
- Clicking the Start button and typing
CMDand then pressing Enter.
- Clicking the Start button and scrolling to the Windows System folder - left-click to open the folder and the left-click Command Prompt
Then type the following command and press Enter.
If the command runs successfully you'll see a message similar to this
Successfully flushed the DNS Resolver Cache
Open the Terminal application from the Applications/Utilities folder or search for it using Spotlight.
Depending on which version of Mac OSX you are running, you should type in the appropriate command and press Enter.
For Mac OS X prior to 10.5.1 (Leopard)
sudo lookupd -flushcache
Mac OS X 10.5 and 10.6 (Leopard and Snow Leopard)
sudo dscacheutil -flushcache
You can obtain a full list of all entries in the cache using this command.
sudo dscacheutil -cachedump -entries
Mac OS X 10.7, OS X 10.8 and OS X 10.9 (Lion, Mountain Lion & Mavericks)
sudo killall -HUP mDNSResponder
OS X 10.10, 10.10.1, 10.10.2 and 10.10.3 (Yosemite)
sudo discoveryutil mdnsflushcache
OS X 10.10.4 and onwards (Yosemite & El Capitan, Sierra, High Sierra, Mojave)
sudo killall -HUP mDNSResponder