Drupal Cache Rebuild vs. DNS Cache Flush: Which Problem Each Can Address

A quick guide to telling a stale Drupal page apart from a stale DNS lookup, and clearing the right one first.

A Drupal cache rebuild clears the website's internal storage of compiled code, configuration, and rendered page data, forcing Drupal to regenerate it. A DNS cache flush clears a computer or server's stored record of which IP address a domain name points to, forcing a fresh lookup. They solve different problems at different layers: one fixes a site that looks broken or outdated to everyone, the other fixes a domain that seems to point to the wrong place for one visitor or network. Confusing the two wastes time, because the symptoms can look similar — a page that "won't update" or a site that "won't load right." Knowing which layer is actually failing (the application serving the page, or the lookup that finds the server at all) determines which command, and which person, actually has the fix.

Table of Contents

What a Drupal cache rebuild actually fixes

Drupal stores a large amount of processed information in its cache so it doesn't have to rebuild every page, menu, and configuration object from scratch on every request. This includes the registry of available plugins, compiled Twig templates, routing tables, and rendered chunks of pages. When a module is enabled or disabled, a configuration setting changes, or custom code is deployed, Drupal sometimes keeps serving the old cached version until the cache is cleared. A cache rebuild is the right move when a logged-in administrator sees a site behaving incorrectly in ways that don't match the current configuration: a new block isn't appearing, a permission change isn't taking effect, a module update broke a page, or the admin menu is missing items it should have.

These are application-level symptoms — the server is reachable and serving pages, but the content or behavior is stale or wrong. It's run from the Drupal admin interface (Configuration > Performance > "Clear all caches") or from the command line with Drush (`drush cache:rebuild` or the shorthand `drush cr`). On larger or more complex sites, a rebuild can take noticeable time because Drupal has to re-scan code, rebuild routes, and re-warm caches on the next page loads. A cache rebuild does nothing for problems outside Drupal itself — a misconfigured server, a bad DNS record, or a browser showing an old version of a page it cached locally. If the site is unreachable rather than merely wrong-looking, the cache isn't the layer to check first.

What a DNS cache flush actually fixes

DNS, the Domain Name System, translates a human-readable domain like example.com into the numeric IP address a browser needs to connect to a server. Operating systems, browsers, and ISPs all keep their own temporary copies of these lookups — a DNS cache — so they don't have to ask a DNS server every single time. That cache has an expiration time, but it can also go stale early or hold an outdated record longer than it should. A DNS cache flush helps when a domain was recently pointed to a new server — after a site migration, a hosting change, or an IP address update — and visitors are still being sent to the old location. It also helps when a domain briefly resolved incorrectly due to a DNS provider issue and a device "remembers" the bad answer even after the record is fixed upstream.

These are reachability problems: the wrong server, or no server, answers the request. Flushing is done per device or per resolver, not on the website itself. On Windows, `ipconfig /flushdns` clears the local cache; on macOS, the command varies by system version (commonly `sudo dscacheutil -flushcache; sudo killall -HUP mDNsResponder`); browsers like Chrome also keep an internal DNS cache clearable from `chrome://net-internals/#dns`. Public DNS resolvers and ISPs maintain their own caches that individual users can't flush directly — those update on their own schedule, governed by the record's TTL (time to live). A DNS cache flush does nothing if the site itself is up-to-date and reachable but showing stale content, and it does nothing to fix a genuinely broken DNS record at the source — it only clears what one device or resolver has stored locally.

How to tell which one actually applies

The fastest way to separate the two is to ask who is affected and what, specifically, looks wrong. If the problem is isolated to how a page's content or functionality behaves — missing blocks, unapplied permissions, old field labels, a theme that didn't update after a deploy — that's almost always a Drupal-side caching issue, not DNS. If the problem is that the domain won't load at all, loads intermittently, or loads a completely different site than expected (including an old site at the same domain after a migration), DNS is the more likely layer.

A simple diagnostic: load the site by its server's raw IP address instead of the domain name. If the site works correctly by IP but not by domain name, the issue sits in DNS, not in Drupal. Another test: open the site in a private/incognito browser window or on a different network (such as a phone on mobile data). If the problem disappears there, it's likely a local DNS or browser cache issue on the original device, not a site-wide Drupal problem — a site-wide problem would still show up on a different network.

  • Symptom only on one device/network, site works fine elsewhere → DNS cache (local)
  • Symptom for everyone, works by IP but content/behavior is wrong → Drupal cache
  • Symptom for everyone, domain goes nowhere or to the wrong server by IP too → not a cache issue at all; check the actual DNS record at the registrar or DNS provider

When neither cache is actually the problem

Both "clear the cache" fixes get reached for reflexively, but a fair number of issues that look like caching are something else. A browser showing an old page even in a private window may mean a CDN (content delivery network) in front of the site, such as Cloudflare, is caching the page separately from Drupal's own cache — that requires purging the CDN's cache too, which is a distinct step from `drush cr`. A DNS record that's actually wrong at the authoritative nameserver won't be fixed by flushing any local cache, because every fresh lookup will keep returning the same bad answer until the record itself is corrected and has time to propagate, which depends on the TTL set on that record.

Propagation delays, not caching, explain a lot of "it's been hours and it still doesn't work" DNS complaints. On the Drupal side, a rebuild won't fix a problem caused by a PHP error, a failed module update, or a database issue — if the site throws errors or a white screen after clearing the cache, the underlying cause is a code or configuration fault, not stale cache data. Running the rebuild is a reasonable first diagnostic step precisely because it's quick and reversible, but it isn't a substitute for checking server logs when the symptom persists. For a site behind both a CDN and Drupal's own layer, the practical order is: clear Drupal's cache first, then purge the CDN, then test in a private browser window — each step removes one possible stale layer, narrowing down where the actual fix needs to happen.

Frequently Asked Questions

Can clearing a DNS cache fix a Drupal site that looks outdated to every visitor?

No. If every visitor sees the same stale content regardless of device or network, the problem is in Drupal's own cache or a CDN in front of it, not DNS.

Does a Drupal cache rebuild affect how fast a domain name resolves?

No. Drupal's cache only affects how the application builds and serves pages once a server is reached; it has no effect on DNS lookups.

Why does a site still show the old version after I flushed my local DNS cache?

The DNS record itself may not have updated yet at the authoritative nameserver, or another cache layer — the browser, a router, or an ISP resolver — still holds the old answer and hasn't expired it.

Is `drush cr` the same as clearing caches through the Drupal admin UI?

They perform the same underlying cache rebuild; Drush's `cache:rebuild` is just the command-line equivalent of the "Clear all caches" button in Configuration > Performance.


You Might Also Like