Flushing your computer's DNS cache can help resolve website browsing issues. This guide will show you how to do it on both Windows and macOS.
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.
Normally DNS records are set with a TTL value of 14400 (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 macOS) 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 may be caching the responses too.
Turn it off and on again! 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 (1.1.1.1 and 1.0.0.1) or Google (8.8.8.8 and 8.8.4.4). 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.
Another easy method to flush your DNS cache is to use the 1.1.1.1 service. This service, provided by Cloudflare, is a public DNS resolver that provides faster and more secure internet browsing. By changing your DNS settings to use the 1.1.1.1 service, you can ensure that your DNS cache is always up-to-date.
ipconfig /flushdns
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:
sudo lookupd -flushcache
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
sudo discoveryutil mdnsflushcache
sudo killall -HUP mDNSResponder
Remember, if you're unsure about something, don't hesitate to reach out to our Brixly support team. We're here to help!