Check DNS Cache
To flush your DNS cache, run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder on macOS, ipconfig /flushdns on Windows, or sudo systemd-resolve --flush-caches on Linux. Clearing the DNS cache forces your system to fetch fresh DNS records instead of using stale cached data.
Why flush your DNS cache?
Every DNS record lookup is cached by default up to the value specified in the time-to-live (TTL) setting of the record.
Whenever you change a record, the old record value may live in your cache until the expiration, giving you the impression that the update was not performed.
Example:
A dig query for the record www.dnsimple.com. Notice the ANSWER section:
$ dig www.dnsimple.com
; <<>> DiG 9.8.3-P1 <<>> www.dnsimple.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 63190
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.dnsimple.com. IN A
;; ANSWER SECTION:
www.dnsimple.com. 3600 IN CNAME dnsimple.com.
dnsimple.com. 600 IN A 50.31.209.238
;; Query time: 605 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Jul 19 15:15:39 2013
;; MSG SIZE rcvd: 64
This is the same query performed a few seconds later. Notice the ANSWER section:
;; ANSWER SECTION:
www.dnsimple.com. 3543 IN CNAME dnsimple.com.
dnsimple.com. 543 IN A 50.31.209.238
Here, dig says to wait 3543 seconds (about an hour) before the cache for the record expires. If a change is made now, it may not be visible from a local machine for an hour.
Note
Flushing the local DNS cache only clears the cache on the device you are using. It does not affect the cache stored by the upstream DNS resolver. If the upstream resolver is still holding outdated data, you will continue to receive the same old response even after flushing your local cache.
You can verify what the upstream resolver is returning by running the dig command shown in the example above, then checking the ANSWER section and TTL. This clarfies whether the delay is coming from the resolver cache or your local machine.
If the upstream resolver already shows the updated record, you can flush your local cache using the methods in Option 1 or Option 2 below.
If you are experiencing DNS resolution issues after clearing your cache, see Troubleshoot Record Resolution Issues or Troubleshoot Domain Resolution Issues for additional help. You can also check your domain’s resolution status to verify your domain is properly configured.
Option 1: everyday methods
Clear the DNS cache before checking a record update. This may involve:
- Clearing your browser cache (Settings → Clear browsing data → Cached images and files).
- Restarting your browser or computer to trigger a fresh lookup.
- Trying another device or network (e.g., mobile data instead of Wi-Fi).
- Using an online DNS lookup tool.
How to flush DNS cache by operating system
You can flush the DNS cache manually. The command varies by operating system:
-
macOS:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder -
Windows:
ipconfig /flushdns- After flushing, you can also refresh your IP address by running:
ipconfig /renew
- After flushing, you can also refresh your IP address by running:
-
Linux (systemd-based distributions):
sudo systemd-resolve --flush-caches
Have more questions?
If you have additional questions or need any assistance with your DNS cache, just contact support, and we will be happy to help.