All articles
On this page

How to Clear DNS Cache on Windows, macOS and Linux

Flush your computer’s DNS cache, refresh browser DNS and check why a website still opens the old hosting server after a DNS change.

Host × IT·Published About 5 min read

After changing your website’s DNS records, your computer may still send you to the previous hosting server. Clearing its local DNS cache lets it request an address again. It can also help when an earlier failed lookup remains cached after you have corrected a DNS record.

Choose the instructions for your operating system below, then refresh your browser and check the result. A local flush does not change your domain’s DNS records or clear the caches used by other visitors.

Before you start

Confirm the hostname you changed: example.com and www.example.com are separate names. Keep the intended destination address handy so you can compare it with a fresh lookup.

If you have not connected the domain yet, follow How to point a domain to Hosting with A records. Flushing a cache cannot replace a missing record or a website domain binding.

Clear DNS cache on Windows 11 or Windows 10

  1. Open Start and search for Command Prompt.
  2. Select Run as administrator and approve the Windows permission prompt.
  3. Enter the following command and press Enter.
ipconfig /flushdns

Windows should report that the DNS resolver cache was flushed successfully. Open the website again after completing the browser steps below. Microsoft documents this command as clearing dynamically cached answers, including negative results from unsuccessful lookups. See the ipconfig reference.

Clear DNS cache on macOS

Open Finder, choose Applications, then Utilities, and open Terminal. On modern macOS versions, run these commands one at a time:

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

Enter your Mac administrator password if prompted. Terminal does not display password characters as you type. These commands usually finish without a success message; if an error appears, resolve it before assuming the flush worked. Older OS X releases used different commands, so check your version before applying historical instructions. The cache utilities and responder command are covered in Cisco’s DNS cache guide.

Clear DNS cache on Linux with systemd-resolved

Linux instructions depend on the resolver actually running on your computer. On systems using systemd-resolved, open a terminal and first inspect its status:

resolvectl status

If it shows the active resolver configuration, flush that service’s cache:

sudo resolvectl flush-caches

You can inspect cache statistics afterward:

resolvectl statistics

A cache may fill again as applications make new requests, so it does not need to remain empty. If resolvectl is unavailable or cannot reach systemd-resolved, use the documentation for your installed resolver instead. Restarting networking is unnecessary for this procedure and can interrupt a remote connection. The systemd resolvectl manual describes these commands.

Refresh your browser’s DNS state

Browsers can keep resolver state separately from the operating system. Save any work, fully quit the browser, reopen it and try the same hostname again.

In Chrome versions that expose the DNS diagnostic page, enter this address directly into the address bar:

chrome://net-internals/#dns

Select Clear host cache if the control is available, then retry the site. Internal diagnostic pages can change between releases; if your version does not provide that control, use a full browser restart. Chromium describes net-internals and its resolver information in its network logging documentation.

Clearing cached images and files addresses a different problem: old page content after you have reached the correct site. Start by identifying which layer is stale rather than deleting all browsing data.

Check the address and the website separately

On Windows, query the domain using nslookup. The same tool is available on many macOS and Linux installations:

nslookup -type=A example.com
nslookup -type=A www.example.com
nslookup -type=AAAA example.com
nslookup -type=AAAA www.example.com

Replace the example names with your own. Look at the answer for the requested domain, rather than mistaking the DNS server address at the top of the output for the website address. The Microsoft nslookup reference explains query types and server selection.

These queries inspect DNS answers; they do not prove which address your browser used or whether the site is configured correctly. If a CDN or proxy is enabled, its public addresses may be the expected answers instead of your hosting origin IP.

Open the root domain and www over HTTPS, then test an inner page. Check for the expected content and a valid certificate. A correct DNS answer alone does not verify the website binding, application or HTTPS setup.

Still seeing the old website?

Use the symptom to choose your next check:

  • DNS still returns the old address: confirm you edited the active DNS provider and the correct hostname. A local flush cannot remove an older answer held by an upstream resolver.
  • One network works and another does not: compare the returned records and account for resolver caching. A VPN or browser Secure DNS setting may use a different resolver.
  • IPv4 is correct but some visitors reach the old site: check whether an outdated AAAA record still directs IPv6 traffic elsewhere.
  • DNS is correct but content is old: investigate browser, application and CDN caches, and confirm the intended files were deployed.
  • The new server responds with a certificate error or default site: check the hostname binding and certificate on the destination.

DNS records have a time to live, or TTL, which controls how long resolvers may cache an answer. Lowering a TTL after a change does not retroactively shorten an answer already cached under the previous value. Avoid promising a fixed propagation time; see Cloudflare’s TTL explanation.

If you are moving an active website, use the DNS cutover checklist to plan destination checks and rollback while preserving email records. When asking Host × IT for help, include the hostname, change time and time zone, expected destination, lookup results and any browser error. That gives support a useful starting point for separating DNS issues from hosting configuration.

🎉 Vibe Hosting is now Host × IT!

Your services are unaffected. Welcome to our new website.

View brand upgrade details