ScreenshotNeo

BlogHow-to

How to Clear the DNS Cache on Windows, Mac, Chrome, Firefox, and Safari

Clear DNS cache on Windows, macOS, Chrome, Firefox, or Safari with the right command or browser control—and learn what to check if it doesn’t help.

By the ScreenshotNeo team29 September 20268 min read

How to Clear the DNS Cache on Windows, Mac, Chrome, Firefox, and Safari

To clear DNS cache, flush the operating system’s resolver cache or use the browser’s own DNS control. On Windows 10 and 11, run ipconfig /flushdns in an administrator Command Prompt. On macOS, run sudo killall -HUP mDNSResponder in Terminal. Chrome and Firefox have browser-specific controls; Safari has no documented DNS-only control in the sources here, so flush the macOS cache.

Use the steps below for the device or browser where the problem occurs. Clearing DNS cache removes locally cached name-to-address results. It does not change records at a domain’s authoritative DNS provider or force global DNS propagation.

1. Choose the cache to clear

A website name such as example.com must be resolved to an IP address before a connection can be made. Operating systems and browsers may retain recent DNS results so they do not have to look them up again immediately. If a cached assignment is stale or a failed lookup was cached, a browser may not reach the site even after the DNS server has changed or recovered.

Browser DNS controls and operating system resolver commands affect different cache scopes.
Browser DNS controls and operating system resolver commands affect different cache scopes.
A local DNS flush discards cached name lookups so the device can request fresh answers.
A local DNS flush discards cached name lookups so the device can request fresh answers.
Where the cache lives Use this when Control Scope
Windows resolver Windows apps or multiple browsers have a name-resolution problem Administrator Command Prompt Windows DNS client cache
macOS resolver Safari or multiple Mac apps cannot resolve a hostname Terminal with administrator authorization macOS DNS cache
Chrome host resolver The issue appears specific to Chrome Chrome internal settings page Chrome host resolver cache
Firefox DNS cache The issue appears specific to Firefox Firefox networking page Firefox DNS cache
Safari The issue appears in Safari on macOS Flush macOS cache; optionally clear Safari history for broader browser data System DNS, or broader Safari data

Start with the narrowest relevant control. If one browser fails but another works, clear that browser’s DNS cache first. If several apps or browsers fail on the same computer, clear the operating system resolver cache. Clearing browsing history is a broader action and is not the same as clearing DNS entries.

2. Clear DNS cache on Windows 10 or Windows 11

  1. Open the Start menu and type Command Prompt.
  2. Choose Run as administrator. Approve the Windows prompt if it appears.
  3. Run this command:
ipconfig /flushdns

Windows should report that the DNS Resolver Cache was successfully flushed. Microsoft documents /flushdns as flushing and resetting the DNS client resolver cache. The command applies to Windows 10 and Windows 11. Cached entries can include values loaded from the Hosts file and recently obtained DNS records; flushing discards negative and other dynamically added entries.

Inspect the Windows cache first

To display cached entries, open an administrator Command Prompt and run:

ipconfig /displaydns

This can help confirm whether Windows has cached an entry for the hostname you are investigating. It is an inspection step, not a requirement before flushing. If the command reports access or privilege problems, reopen Command Prompt with Run as administrator and retry.

3. Clear DNS cache on macOS

  1. Open Terminal from Applications > Utilities, or search for Terminal with Spotlight.
  2. Run:
sudo killall -HUP mDNSResponder
  1. Enter your Mac administrator password when prompted, then press Return. Terminal does not show characters while you type the password.

The command sends a hang-up signal to the macOS DNS responder process, which clears the system DNS cache. The documented command applies to macOS X 10.10.4 and later. If Terminal says your account is not permitted to use sudo, use an administrator account or ask the Mac administrator to run it. Restarting macOS is another way Mozilla documents to flush the system DNS cache, though it takes longer and interrupts open work.

4. Clear DNS cache in Google Chrome

  1. Open Chrome.
  2. Enter chrome://net-internals/#dns in the address bar and press Return.
  3. Under Host resolver cache, click Clear host cache.
  4. Retry the page that failed.

This targets Chrome’s host resolver cache. It does not clear Windows or macOS system DNS entries. If the failure occurs in other apps or browsers too, flush the operating system cache as well.

If you suspect other stored browser data is involved, Chrome’s Clear browsing data flow is a broader fallback. It can affect more than DNS, so select the data types and time range deliberately. Do not treat general history or cache clearing as a DNS-only operation.

5. Clear DNS cache in Mozilla Firefox

  1. Open Firefox.
  2. Enter about:networking#dns in the address bar and press Return.
  3. Click Clear DNS cache.
  4. Load the affected site again.

This clears Firefox’s DNS cache. If the problem continues, try the same hostname in another browser. Mozilla recommends checking whether the issue occurs outside Firefox: if it does, investigate the system or network; if it does not, focus on Firefox-specific settings or data.

6. Clear DNS cache for Safari

Safari has no dedicated DNS-cache button documented in the sources used for this guide. On macOS, use the system command in section 3:

sudo killall -HUP mDNSResponder

That flushes the macOS resolver cache Safari uses. Safari’s History > Clear History option is a separate, broader browser-data action; it is not documented as a DNS-only control. Use it only if you also intend to clear Safari history and associated browsing data.

7. Verify the fix and narrow down the cause

  1. Retry the exact hostname. Use the same full domain that failed, including any subdomain.
  2. Try another browser. If one browser works and another does not, the remaining issue is likely browser-specific.
  3. Try another app or device on the same network. If several devices fail, the cause may be the router, DNS server, ISP, or network configuration.
  4. Check whether the hostname resolves at all. A flush only discards a local cached result; it cannot fix an incorrect DNS record, unavailable server, firewall rule, or broken connection.
  5. Recheck after a DNS change. A local flush does not alter DNS records or guarantee that updated records are available from every resolver.

If clearing the relevant cache does not help, Mozilla’s troubleshooting guidance points to wireless connectivity, ISP, and DNS-server problems as possible causes. Also consider local firewall or router configuration and general network connectivity. Test a known-working site to distinguish one-domain trouble from a broader connection failure.

8. Troubleshooting common problems

Symptom Likely cause What to do
Windows says the command requires elevation Command Prompt was opened without administrator privileges Close it, reopen with Run as administrator, and run ipconfig /flushdns.
Mac asks for a password but shows no typing Terminal hides password characters during sudo entry Type the administrator password anyway and press Return.
sudo rejects the Mac account The account lacks administrator authorization Use an administrator account or have the Mac administrator run the command.
Chrome control does not resolve the issue The stale result may be in the OS cache, or the cause may not be DNS Flush the Windows or macOS resolver too, then test another browser and device.
Firefox still cannot open the site The issue may be network-wide or unrelated to DNS Test another browser, then check connectivity, DNS server, wireless, firewall, and ISP.
Safari has no DNS clear button Safari does not provide a documented DNS-only control here Flush macOS DNS with sudo killall -HUP mDNSResponder.
The site remains unavailable after a successful flush The cache was not the root cause, or the DNS/network issue persists upstream Check the DNS server and network path; a local flush cannot repair authoritative records or connectivity.
Only one device or network fails Local resolver, router, VPN, firewall, or network-specific configuration Compare another device and network, then narrow down the differing configuration.

9. Reliability, performance, and what a flush costs

Flushing is a local troubleshooting action. Until fresh answers are obtained, applications may need to resolve names again. The commands above do not promise that a particular website will become reachable; success depends on the DNS answer and network path available after the cache is cleared.

Use the browser control when the problem is isolated to a browser, and the system command when multiple applications are affected. Avoid repeatedly clearing all browser data as a first response: it removes more state than DNS entries and can make diagnosis harder. For recurring failures, record the hostname, time, browser, device, and whether other devices on the same network can resolve it. That evidence helps distinguish a local cache issue from a DNS-server or network issue.

10. Capture the page after DNS troubleshooting

Once the site loads again, you may need a reproducible screenshot for a bug report, documentation, or visual review. You can capture it in a locally configured browser automation script, or use a screenshot API. ScreenshotNeo is a website screenshot API and MCP server from Yorker Media. Its one-call endpoint returns a PNG, JPEG, WebP, or PDF. The examples and parameters are in the ScreenshotNeo API documentation.

Or skip the browser setup

Use a GET request with your API key and the page URL. Replace the sample target with the page you want to capture.

curl -G "https://api.screenshotneo.com/v1/shot" \
  -d access_key=YOUR_API_KEY \
  --data-urlencode url=https://stripe.com \
  -o shot.webp
import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({
  access_key: 'YOUR_API_KEY',
  url: 'https://stripe.com'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
await Bun.write('shot.webp', res);

ScreenshotNeo accepts cookie and consent banners like a visitor, then removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. Its MCP server offers take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

The free plan includes 1,000 shots a month with no card. Paid plans start at $5 for 3,000 shots; every feature is available on every plan. For captures from public pages, use the API key carefully and consult the docs for available output and capture options. Sign up for 1,000 free screenshots a month, with no card required.

11. Frequently asked questions

Does flushing DNS delete saved passwords or bookmarks?

The DNS flush commands clear resolver entries. They are separate from browser actions such as clearing history or browsing data.

Should I flush DNS after changing a domain’s records?

It can discard a stale answer cached on your own device. It does not change the domain’s records or control caches held by DNS resolvers elsewhere.

Why does a site work on my phone but not my computer?

The devices may use different cached answers, DNS servers, VPNs, or network settings. Compare them on the same network and try the appropriate local cache flush before investigating the configuration differences.

Do I need to flush every browser and the operating system?

No. Start where the failure occurs. Clear a browser’s cache for a browser-only issue; clear the OS resolver when multiple apps are affected. If the problem crosses both scopes, clear both relevant caches.